yrutschle
e4936454c5
refactor: take time only once when computing UPD timeouts
2021-08-05 17:05:08 +02:00
yrutschle
7fb65ad0ac
refactor: remove sideeffects from udp_timedout
2021-07-18 21:50:40 +02:00
yrutschle
c43882c85f
refactor: move timeout management to separate function
2021-07-18 21:36:46 +02:00
yrutschle
e7df8eeaa1
removed static known_source arrays, UDP connections are now managed dynamically
2021-07-07 19:58:08 +02:00
yrutschle
862e33cfec
moved UDP support from sslh-fork to sslh-select
2021-07-01 22:44:35 +02:00
yrutschle
1ad450a444
sslh-select sets O_NONBLOCK *before* calling connect, which prevents hanging on an unresposive server ( fix #258 )
2021-05-28 13:38:45 +02:00
yrutschle
4c570e8d57
remove some debug messages
2021-04-21 08:48:31 +02:00
yrutschle
0a00220b42
justify use of select
2021-04-21 08:43:21 +02:00
yrutschle
b258b0e0f7
manage probing sockets in a specific list instead of searching through all connections
2021-04-19 09:38:22 +02:00
yrutschle
41a914b350
alloc_cnx returns cnx pointer instead of simple error code
2021-04-17 21:29:38 +02:00
yrutschle
dfa5d3cedb
simplified some redundant parameters
2021-04-17 17:53:45 +02:00
yrutschle
de474e1d07
stop managing connections as array; instead, allocate connections, and fd2cnx is the only pointer to it
2021-04-14 23:26:01 +02:00
yrutschle
7485afe397
refactor accept to its own function
2021-04-10 08:26:22 +02:00
yrutschle
417722e3c1
remove obsolete definitions
2021-04-03 21:40:53 +02:00
yrutschle
9fca586735
remove over-verboseness
2021-04-03 21:39:43 +02:00
yrutschle
0613d412a2
refactor: write activity checked on select output rather than on each connection object
2021-04-03 21:34:47 +02:00
yrutschle
3edf6a9d22
refactor: move write process to its own function
2021-04-02 22:20:04 +02:00
yrutschle
7a88a50c32
refactor: remove redundant paramters
2021-04-02 16:02:23 +02:00
yrutschle
e7a5bbc4e1
removed some over-verboseness
2021-03-30 20:16:38 +02:00
yrutschle
40557c58ad
working version with read activity checked on select output rather than on each connection object
2021-03-29 21:56:21 +02:00
yrutschle
f51781664c
add server-side file descriptor to collection
2021-03-28 12:22:36 +02:00
yrutschle
5948270b95
update API
2021-03-28 11:47:33 +02:00
yrutschle
15a5073559
keep track of which connection contains what file descriptor
2021-03-23 22:58:10 +01:00
yrutschle
c2b6bf246c
refactor: make collection part of select object
2021-03-23 21:43:07 +01:00
yrutschle
6366d50b89
refactor: use fd_info instead of passing fd_sets directly
2021-03-23 13:59:15 +01:00
yrutschle
5b93e4ab55
abstracted collection management to its own file
2021-03-21 16:42:37 +01:00
yrutschle
1c63b06cc8
refactor: move collection handling towards a foreach construct
2021-03-21 14:01:12 +01:00
yrutschle
71c617050d
fix collection extension
2021-03-17 21:16:08 +01:00
yrutschle
7e63dedca3
refactor: abstract connection list management to a new 'collection' type
2021-03-03 14:38:24 +01:00
yrutschle
be4e126f3a
refactor: move all read process code to its own function
2021-02-28 18:19:18 +01:00
yrutschle
34bcc2bbc8
refactor: move probing actions to its own function
2021-02-28 10:46:17 +01:00
yrutschle
90975fd6c3
refactor: move all file descriptor info for select to its own struct
2021-02-28 10:12:13 +01:00
yrutschle
f91f16d753
make local functions static
2021-02-27 15:33:41 +01:00
yrutschle
dae8101a50
remove redundant macro definition
2021-02-27 15:20:15 +01:00
yrutschle
52a9356c35
fix typo
2021-01-09 15:34:09 +01:00
yrutschle
f3230b4a94
abstract listening sockets so we have protocol information alongside the socket -- echosrv and sslh-select
2020-11-07 22:44:37 +01:00
yrutschle
3aa245efa5
separate connection information creationg from log emission
2019-09-05 15:48:33 +02:00
yrutschle
d5baed3f18
Fix fd2fd return value which should not be -1 on error
2019-05-13 15:21:22 +02:00
yrutschle
e7ce929020
config file now read to struct with c2s; command line no longer works
2018-11-29 11:56:33 +01:00
Michael Santos
8ce2b2ea05
Check memory allocations succeed
2018-06-18 10:35:28 -04:00
Michael Santos
cfd0163a5b
main_loop: initialize in_socket
...
in_socket may be used uninitialized if no addresses are available.
~~~
sslh-select.c:415:8: warning: Function call argument is an uninitialized value
check_access_rights(in_socket, cnx[i].proto->service)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
2018-06-18 10:35:28 -04:00
Yves Rutschlé
3ab2acdafa
fix fork failure handling
2018-01-11 14:45:32 +00:00
Yves Rutschlé
9a85efded5
log error message in case fork fails
2018-01-08 18:54:01 +00:00
yrutschle
d26eab728c
Merge pull request #143 from astiob/select-fork
...
sslh-select: support forking for particular protocols
2018-01-02 22:26:58 +01:00
Yves Rutschle
b36fc73b7a
log timeouts
2017-12-17 14:57:45 +01:00
Oleg Oshmyan
2a70470f13
sslh-select: reduce CPU and memory usage in forked processes
2017-10-28 23:27:10 +03:00
Oleg Oshmyan
2544f20bdf
sslh-select: support forking for particular protocols
...
To keep the code simple, use the same event loop in the child process
as in the parent process but close all irrelevant file descriptors.
2017-10-28 23:27:06 +03:00
Oleg Oshmyan
b7fafb5039
sslh-select: invoke FD_CLR on fd before closing fd
...
POSIX requires the fd argument to any FD_ macro to be valid.
2017-10-28 23:13:28 +03:00
Oleg Oshmyan
b56f302b85
sslh-select: simplify some code
2017-10-28 23:13:28 +03:00
Oleg Oshmyan
684c9afcc6
sslh-select: actually close socket on error in accept_new_connection
...
Previously, it was leaked (and the client was left waiting for a timeout).
2017-10-28 23:13:28 +03:00