Skip to content
Snippets Groups Projects
Commit 4de72bfe authored by deuce's avatar deuce
Browse files

Do not call recv() after we know that we disconnected and a recv() of zero

bytes still means that we have disconnected.

Fixes 100% CPU after remote drops connection problem.
parent 124709da
No related branches found
No related tags found
No related merge requests found
......@@ -403,7 +403,7 @@ int recv_byte(void* unused, unsigned timeout)
static uchar telnet_cmd;
static int telnet_cmdlen;
while(!terminate) {
while((inbuf_len || connected) && !terminate) {
if(inbuf_len) {
ch=inbuf[inbuf_pos++];
i=1;
......@@ -450,6 +450,10 @@ int recv_byte(void* unused, unsigned timeout)
break;
}
}
else if(i==0) {
connected=FALSE;
break;
}
else
inbuf_len=i;
continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment