cURL / Mailing Lists / curl-library / Single Mail

curl-library

SOCKS proxy problem

From: Dmitriy Sergeyev <dsergeyev_at_issart.com>
Date: Thu, 14 Sep 2006 20:42:09 +0700

Hello,

It seems that handleSock4Proxy and handleSock5Proxy has one problem
while receiving response from SOCKS proxy. Both of them uses
Curl_read() to read the response, but when proxy sends the response
byte-by-byte (just like my sample SOCKS server) Curl_read() sometimes
returns only one byte instead of several stated in buffersize.
And it causes failure of these functions. For example url.c:1989

The only way I have found to solve this problem is to add something
like Curl_read_all() function that performs Curl_read() until entire
buffer will be filled. Is this a good solution?

And may be hadnleSocks* functions in case of failure must to
return CURLE_COULDNT_CONNECT instead of 1 ? Because ConnectPlease()
function verifies only this return value to determine the failure.
But CURLE_COULDNT_CONNECT == 7 and it returns CURLE_OK even if
handleSocks failed (url.c:2324)

libcurl is 7.15.5

-- 
Best regards,
 Dmitriy                          mailto:dsergeyev_at_issart.com
Received on 2006-09-14