mirror of
https://github.com/weechat/weechat.git
synced 2026-07-01 07:16:37 +02:00
xfer: set TCP_NODELAY on recv side
This works around hangs where only a couple of bytes could be sent to the socket and retrying to send the last bytes of the ack never seem to work. Closes #1167.
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <poll.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
#include <netdb.h>
|
||||
@@ -345,6 +346,11 @@ xfer_dcc_recv_file_child (struct t_xfer *xfer)
|
||||
return;
|
||||
}
|
||||
|
||||
/* set TCP_NODELAY to be more aggressive with acks */
|
||||
/* ignore error as transfer should still work if this fails */
|
||||
flags = 1;
|
||||
setsockopt(xfer->sock, IPPROTO_TCP, TCP_NODELAY, &flags, sizeof(flags));
|
||||
|
||||
/* connection is OK, change DCC status (inform parent process) */
|
||||
xfer_network_write_pipe (xfer, XFER_STATUS_ACTIVE,
|
||||
XFER_NO_ERROR);
|
||||
|
||||
Reference in New Issue
Block a user