cURL / Mailing Lists / curl-library / Single Mail

curl-library

Curl_read() silently ignores an error during read

From: Kamil Dudka <kdudka_at_redhat.com>
Date: Wed, 17 Mar 2010 19:12:35 +0100

Hello,

while looking into https://bugzilla.redhat.com/565972 I discovered something
odd in the Curl_read() function. Even when it gets an error from
Curl_ssl_recv(), it returns CURLE_OK and therefor drops any track about the
error which occurred. Is it anyhow intentional?

Thanks in advance for any hint!

Kamil

(gdb) break Curl_ssl_recv
(gdb) run
Breakpoint 1, Curl_ssl_recv (conn=0x63d120, sockindex=0, mem=0x620cb0 "",
len=16384) at sslgen.c:423
423 bool block = FALSE;
(gdb) next
425 nread = curlssl_recv(conn, sockindex, mem, len, &block);
(gdb) next
426 if(nread == -1) {
(gdb) next
427 if(!block)
(gdb) next
428 return 0; /* this is a true error, not EWOULDBLOCK */
(gdb) next
Curl_read (conn=0x63d120, sockfd=7, buf=0x620cb0 "SSL read: errno -12269\n",
sizerequested=16384, n=0x7fffffffd2f8) at sendf.c:541
541 if(nread == -1) {
(gdb) next
573 if(nread >= 0) {
(gdb) next
574 if(pipelining) {
(gdb) next
580 *n += nread;
(gdb) next
583 return CURLE_OK;
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-03-17