diff options
author | Test_User <hax@andrewyu.org> | 2024-06-19 08:48:20 -0400 |
---|---|---|
committer | Test_User <hax@andrewyu.org> | 2024-06-19 08:48:20 -0400 |
commit | ab45d828cea484f72ec8573a29524894eb9b24ac (patch) | |
tree | d96114631cd6d9054ca65d76a3dda32a016e7a03 /networks/plaintext.c | |
parent | c3d40c8d4671c59414c737b00cc55eb5d44992c9 (diff) | |
download | haxircd-ab45d828cea484f72ec8573a29524894eb9b24ac.tar.gz haxircd-ab45d828cea484f72ec8573a29524894eb9b24ac.zip |
Mark futexes as private since it's all same-process, fix timeout on plaintext connections
Diffstat (limited to 'networks/plaintext.c')
-rw-r--r-- | networks/plaintext.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/networks/plaintext.c b/networks/plaintext.c index 4279f8c..7914b9e 100644 --- a/networks/plaintext.c +++ b/networks/plaintext.c @@ -143,6 +143,15 @@ int plaintext_accept(int listen_fd, void **handle, struct string *addr) { if (con_fd == -1) return -1; + { + struct timeval timeout = { + .tv_sec = PING_INTERVAL, + .tv_usec = 0, + }; + + setsockopt(con_fd, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); + } + addr->data = malloc(address_len); if (addr->data == 0 && address_len != 0) { close(con_fd); |