1.48b: SSL handling bugfixes

- A fix to SSL handling to avoid mystery fetch failures when
      talking to certain servers.
This commit is contained in:
Steve Pinkham 2010-07-05 22:43:58 -04:00
parent 99fdd5f699
commit 0d9f8c7fc5
3 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Version 1.48b:
--------------
- A fix to SSL handling to avoid mystery fetch failures when
talking to certain servers.
Version 1.47b:
--------------

View File

@ -20,7 +20,7 @@
#
PROGNAME = skipfish
VERSION = 1.47b
VERSION = 1.48b
OBJFILES = http_client.c database.c crawler.c analysis.c report.c
INCFILES = alloc-inl.h string-inl.h debug.h types.h http_client.h \

View File

@ -2022,6 +2022,8 @@ network_error:
s32 read_res;
u8 p_ret;
SSL_read_more:
c->read_buf = ck_realloc(c->read_buf, c->read_len + READ_CHUNK + 1);
if (c->proto == PROTO_HTTPS) {
@ -2029,6 +2031,7 @@ network_error:
c->SSL_rd_w_wr = 0;
read_res = SSL_read(c->srv_ssl, c->read_buf + c->read_len,
READ_CHUNK);
@ -2051,6 +2054,10 @@ network_error:
c->read_len += read_res;
c->read_buf = ck_realloc(c->read_buf, c->read_len + 1);
/* Retry reading until SSL_ERROR_WANT_READ. */
if (read_res && c->read_len < size_limit) goto SSL_read_more;
c->read_buf[c->read_len] = 0; /* NUL-terminate for sanity. */
/* We force final parse_response() if response length exceeded