From 4931fbce49887f7d4022c39ea7d94c4294b5f479 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 14 Jan 2002 23:14:59 +0000 Subject: Curl_read() now returns a negative return code if EWOULDBLOCK or similar --- lib/http.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/http.c') diff --git a/lib/http.c b/lib/http.c index ffb442089..795a6f79c 100644 --- a/lib/http.c +++ b/lib/http.c @@ -235,6 +235,7 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, int subversion=0; struct SessionHandle *data=conn->data; CURLcode result; + int res; int nread; /* total size read */ int perline; /* count bytes per line */ @@ -317,8 +318,12 @@ CURLcode Curl_ConnectHTTPProxyTunnel(struct connectdata *conn, * to read, but when we use Curl_read() it may do so. Do confirm * that this is still ok and then remove this comment! */ - if(CURLE_OK != Curl_read(conn, tunnelsocket, ptr, BUFSIZE-nread, - &gotbytes)) + res= Curl_read(conn, tunnelsocket, ptr, BUFSIZE-nread, + &gotbytes); + if(res< 0) + /* EWOULDBLOCK */ + continue; /* go loop yourself */ + else if(res) keepon = FALSE; else if(gotbytes <= 0) { keepon = FALSE; -- cgit v1.2.3