Skip to content
Snippets Groups Projects
Commit 411520fd authored by deuce's avatar deuce
Browse files

Increase putcom() timeout to 10 seconds to allow network buffers to drain.

parent b4106a1a
Branches
Tags
No related merge requests found
......@@ -51,8 +51,19 @@ void putcom(char* buf, size_t len)
FD_ZERO(&wds);
FD_SET(telnet_sock, &wds);
struct timeval tv;
tv.tv_sec=0;
tv.tv_usec=1000;
tv.tv_sec=10;
tv.tv_usec=0;
/*
* Note, this select() call was added when debugging file transfer
* issues presumably because something made it appear to "hang forever".
* Since blocking sockets are used, this is very much not a complete
* fix as the buffer size will usually be greater than the one byte
* select() guarantees you will be able to send().
*
* The original fix waited 1ms in select(), which is unlikely to actually
* allow the ACK to come back fast enough to clear a full output buffer.
* I've increased it to 10s and left the select() in place.
*/
if(select(telnet_sock+1, NULL, &wds, NULL, &tv) == 1) {
char str[128];
char* p=str;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment