ku-suke / skipfish

Automatically exported from code.google.com/p/skipfish
Apache License 2.0
0 stars 0 forks source link

big page load false sometimes.if a O_NONBLOCK socket return -1, skipfish should read it again while errno is EAGAIN. #106

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
version:
     skipfish-1.84b

http_client.c:2071
      if (read_res <= 0) goto network_error;

fix:
      if (read_res <= 0 && errno != EAGAIN)   goto network_error;

Original issue reported on code.google.com by bsn0w...@gmail.com on 26 Jan 2011 at 10:18

GoogleCodeExporter commented 9 years ago
Were you running into any specific problem here? The code is called only after 
poll() indicated that data is available for reading on that descriptor; it 
would be odd for a subsequent read() to return EAGAIN, although I might be 
wrong.

Original comment by lcam...@gmail.com on 26 Jan 2011 at 6:50

GoogleCodeExporter commented 9 years ago
(And in any case, your fix introduces a potential security vulnerability - if 
read_res is negative, you really don't want the subsequent code to execute)

Original comment by lcam...@gmail.com on 26 Jan 2011 at 6:51

GoogleCodeExporter commented 9 years ago
I think you are right .I hava found the cause of this bug.
The Difference between our modifications of the other line is the predisposing 
factor.

your code:
http_client.c:2081
          if (c->proto == PROTO_HTTPS &&
              read_res && c->read_len < size_limit) goto SSL_read_more;

my corresponding code:
        if (read_res == READ_CHUNK) goto READ_MORE;

so ,the bug does not exist at your branch.

Original comment by bsn0w...@gmail.com on 31 Jan 2011 at 7:04

GoogleCodeExporter commented 9 years ago
OK

Original comment by lcam...@gmail.com on 31 Jan 2011 at 7:07