Commit Graph
53 Commits
Author SHA1 Message Date
Vladimir Dubrovin 375e3a74d0 call local socket function 2024-02-18 19:41:45 +03:00
Vladimir Dubrovin 8198db8617 adding state to socket functions 2024-02-17 17:31:25 +03:00
Vladimir Dubrovin 55d1bbe155 Grace delay feature added
`proxy -g8000,3,10`

First parameter is average read size we want to keep, second parameter is
minimal number of packets in the same direction to apply algorythm,
last value is delay added after polling and prior to reading data.
An example above adds 10 millisecond delay before reading data if average
polling size is below 8000 bytes and 3 read operations are made in the same
direction. It's specially usefule with splice. `logdump 1 1` is useful
to see how grace delays work, choose delay value to avoid filling the read
pipe/buffer (typically 64K) but keep the request sizes close to chosen average
on large file upload/download.
2022-05-19 18:51:02 +03:00
z3apa3a e1b4e50242 Copyright update 2021-07-02 11:50:33 +03:00
z3apa3a d7eb9fb82f better error handling on splice() 2021-05-18 11:34:57 +03:00
z3apa3a 1bd6eff0e6 Update sockmap.c 2021-05-17 18:12:50 +03:00
z3apa3a aac5c9fff9 More accurate error handling on socket mapping 2021-05-15 18:42:17 +03:00
z3apa3a 6279e86086 Do not terminate connection on POLLHUP if there is a data to read 2021-04-22 16:59:07 +03:00
z3APA3A d2dcf4bb69 better dat filters handling 2020-11-19 02:30:19 +03:00
z3APA3A 021314d6f5 Fix bandlim handling 2020-11-11 17:40:46 +03:00
z3APA3A ee0eac51d6 Remove RDHUP processing
Do not actually need it, may lead to connection closed before all data
read
2020-11-02 16:10:04 +03:00
z3APA3A b2f82ed04f More accurate conditions in sockmap's main event loop 2020-10-19 13:11:44 +03:00
z3APA3A 3f2659cb0f Use MAXFAILATTEMPT to limit socket failuers 2020-10-15 16:44:32 +03:00
z3APA3A aeb0f4caa5 Better handle socket closing 2020-10-15 16:27:39 +03:00
z3APA3A 9f6a8460ac limit failed mapping attempts to 13 2020-10-15 01:17:10 +03:00
z3APA3A 637cb2e76d adding guard for polling loop to prevent CPU exhastion in the case of system misbihavior 2020-10-14 18:58:52 +03:00
z3APA3A 47affa0add Correct returning 98 code from socksmap 2020-10-14 16:15:11 +03:00
z3APA3A eb829b062b Major code refactoring
- sockmapping rewritten from stratch to minimilse polling. poll() is now
only called if blocking is actually expected, splice pipes are now
polled if splice fails, buffers flushing is much more accurate.
- logging code moved to separate files
- signal masks added to client threads to prevent unneeded interruptions
- bandwidth limitation will not delay the thread after client or server
shutdown
2020-10-09 15:42:34 +03:00
z3APA3A 5ee553e9a9 Correct: do not log 98/99 as an error 2019-01-20 17:52:00 +03:00
z3APA3A 8af9ea8de8 back to non-blockin splice on sending 2019-01-11 23:26:52 +03:00
z3APA3A 603ab8187f make spliced sockmap more reliable 2019-01-11 23:10:39 +03:00
z3APA3A 03efdc451b Add POLLRDHUP support to spliced sockmap 2019-01-11 19:12:03 +03:00
z3APA3A 930d9823ea Use futex instead of pthread_mutex on Linux 2018-12-28 18:49:45 +03:00
z3APA3A 3f2e621902 Correct socket polling on mapping 2018-12-06 00:32:37 +03:00
z3APA3A b7e3a85e88 Use non-blocking splice only on write to socket
to prevent race condition data is not copied to the pipe yet
2018-12-05 23:41:37 +03:00
z3APA3A 79ea433caf Can go to 100% CPU if one side have closed connection 2018-12-05 21:44:59 +03:00
z3APA3A 3d9ac1e1fb Flush splice pipe on socket close 2018-05-12 01:19:11 +03:00
z3APA3A 12b5ad143f correct trafic accounting in spliced map 2018-04-27 01:52:08 +03:00
Vladimir Dubrovin b7c667a682 Bugfixes for previous commit 2018-04-23 02:00:53 +03:00
Vladimir Dubrovin 97b97a5664 Typo corrected 2018-04-23 02:00:34 +03:00
z3APA3A 531e0707cf Simplify splicemap 2018-04-23 02:00:19 +03:00
z3APA3A b3abf80a50 slicedmap - replace usleep with poll, remove SPLICE_F_MOVE
use poll instead of usleep (to get rid of potential blocking in future)
remove SPLICE_F_MOVE
2018-04-22 23:23:22 +03:00
z3APA3A fd588949c9 remove unneeded check 2018-04-22 22:44:06 +03:00
z3APA3A a42bb38d76 Use WSAPoll on Windows (except lite version) 2018-04-21 23:57:42 +03:00
z3APA3A d40e5d458c FIX: tcppm may not work with parent proxy 2017-02-02 00:36:59 +03:00
z3APA3A f709255d62 Copyrights cleaned, authradius.c added 2016-12-20 15:47:02 +03:00
z3apa3a d159c57e1f Add splice() support on Linux to proxy, socks, ftppt, smtpp, pop3p
usage example:
proxy -s
proxy -s2
-s - enable splice() for sockets mapping to avoid data to be copied to user space
-s2 - enable splice() and attempt to free user space buffer ASAP
2016-12-19 22:07:34 +03:00
z3apa3a 6696b35d74 Added -s option support for proxying with splice() for Liux
(without copying network data to
userspace). Currently only for tcppm.
2016-12-19 02:56:23 +03:00
z3APA3A cfa4d11027 Do not fail connection with 333 error on configuration reload 2016-04-26 18:50:57 +03:00
Vladimir Dubrovin e210f24194 fix for noforce 2016-04-02 12:00:53 +03:00
Vladimir Dubrovin 2fed299b9d warning fix 2016-04-02 11:22:33 +03:00
z3APA3A 938b1d1aab re-authenticate connection on configuration change 2016-03-28 17:57:37 +03:00
z3APA3A eeb2d78fb1 re-authenticate user on 2016-03-28 17:49:27 +03:00
z3APA3A 3b8e7741b3 Compilation warnings cleanup 2016-02-16 15:29:51 +03:00
z3APA3A e37a7f48d7 Older CVS comments removed 2014-12-13 23:20:00 +03:00
z3APA3A c7310a2060 initial partial patches for IPv6 client support 2014-10-19 21:54:24 +04:00
z3APA3A 8975b00cce better EINTR handling 2014-06-11 01:54:25 +04:00
Vladimir Dubrovin a30d5d51a5 IPv6 server side code
+ IPv6 server side support
!!! Auth need to be fixed
2014-05-12 01:10:58 +04:00
z3APA3A f4c6c9d962 legacy counters code removed 2014-04-14 02:14:34 +04:00
Vladimir Dubrovin 90ca18b3c1 Revert "temp debugging"
This reverts commit 97d811fbfd.
2014-04-10 04:11:55 +04:00