mirror of
https://github.com/curl/curl.git
synced 2025-01-30 14:22:33 +08:00
telnet.c: fix handling of 0 being returned from custom read function
According to [1]: "Returning 0 will signal end-of-file to the library and cause it to stop the current transfer." This change makes the Windows telnet code handle this case accordingly. [1] http://curl.haxx.se/libcurl/c/CURLOPT_READFUNCTION.html
This commit is contained in:
parent
0c050662b7
commit
03fa576833
@ -1439,8 +1439,10 @@ static CURLcode telnet_do(struct connectdata *conn, bool *done)
|
||||
if(result == CURL_READFUNC_PAUSE)
|
||||
break;
|
||||
|
||||
if(result == 0) /* no bytes */
|
||||
if(result == 0) { /* no bytes, means end-of-file */
|
||||
keepon = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
readfile_read = result; /* fall thru with number of bytes read */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user