Skip to content

Commit

Permalink
Fix: support http bodies larger than 2 GB (#223)
Browse files Browse the repository at this point in the history
Co-authored-by: ec <[email protected]>
  • Loading branch information
edcuba and ec authored Sep 23, 2020
1 parent 339bd2d commit 7fd918d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/scan_http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,13 @@ int scan_http_cbo::on_body(const char *at,size_t length)

/* If not decompressing, just write the data and return. */
if(unzip==false){
int rv = write(fd,at,length);
if(rv<0) return -1; // write error; that's bad
bytes_written += rv;
size_t offset = 0;
while (offset < length) {
int rv = write(fd, at + offset, length - offset);
if (rv < 0) return -1; // write error; that's bad
offset += rv;
}
bytes_written += offset;
return 0;
}

Expand Down

0 comments on commit 7fd918d

Please sign in to comment.