Wireshark-bugs: [Wireshark-bugs] [Bug 5802] Rewrite&cleanup wiretap/file_wrappers

Date: Wed, 6 Apr 2011 11:35:08 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5802

--- Comment #17 from Jakub Zawadzki <darkjames@xxxxxxxxxxxxxxxx> 2011-04-06 11:35:07 PDT ---
(In reply to comment #16)
> If by "FILE i/o" you mean fread()

Yes, upcase FILE from structure name :)

> I'm a little surprised that standard I/O does better than the new code with a
> GZBUFSIZE of 4K, as I suspect both of them are doing 4K reads in that case, so
> the amount of "wasted" data read in - i.e., data you read in but won't use
> because the next packet you read won't overlap with that 4K chunk.

Actually when GZBUFSIZE is 4K, uncompressed data is read in 8K chunk ;/
but it's easy to fix. Inside fill_out_buffer():
-        if (raw_read(state, state->out, state->size << 1, &(state->have)) ==
-1)
+        if (raw_read(state, state->out, state->size, &(state->have)) == -1)

Anyway what you think about adding fstat() to get filesystem blocksize?

Maybe standard i/o is aligning seeks to block size? Or some compiler
optimizations? (I have wireshark compiled with -O0 :>)

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.