scan_http.cpp (tcpflow-1.5.0) | : | scan_http.cpp (tcpflow-1.6.1) | ||
---|---|---|---|---|
skipping to change at line 275 | skipping to change at line 275 | |||
if (fd < 0) return -1; // no open fd? (internal error)x | if (fd < 0) return -1; // no open fd? (internal error)x | |||
if (length==0) return 0; // nothing to write | if (length==0) return 0; // nothing to write | |||
if(first_body){ // stuff for first time on_body is call ed | if(first_body){ // stuff for first time on_body is call ed | |||
xml_fo << " <byte_run file_offset='" << (at-base) << "'><fileobject> <filename>" << output_path << "</filename>"; | xml_fo << " <byte_run file_offset='" << (at-base) << "'><fileobject> <filename>" << output_path << "</filename>"; | |||
first_body = false; | first_body = false; | |||
} | } | |||
/* If not decompressing, just write the data and return. */ | /* If not decompressing, just write the data and return. */ | |||
if(unzip==false){ | if(unzip==false){ | |||
int rv = write(fd,at,length); | size_t offset = 0; | |||
if(rv<0) return -1; // write error; that's bad | while (offset < length) { | |||
bytes_written += rv; | 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; | return 0; | |||
} | } | |||
#ifndef HAVE_LIBZ | #ifndef HAVE_LIBZ | |||
assert(0); // shoudln't have gotten here | assert(0); // shoudln't have gotten here | |||
#endif | #endif | |||
if(zfail) return 0; // stream was corrupt; ignore rest | if(zfail) return 0; // stream was corrupt; ignore rest | |||
/* set up this round of decompression, using a small local buffer */ | /* set up this round of decompression, using a small local buffer */ | |||
/* Call init if we are not initialized */ | /* Call init if we are not initialized */ | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 7 lines changed or added |