Found an interesting bug in libsoup on Windows
- From: "Tor Lillqvist" <tml iki fi>
- To: libsoup-list gnome org
- Subject: Found an interesting bug in libsoup on Windows
- Date: Wed, 4 Jun 2008 16:45:15 +0300
Fixed now in trunk:
2008-06-04 Tor Lillqvist <tml novell com>
* libsoup/soup-socket.c (set_fdflags): The SO_RCVTIMEO and
SO_SNDTIMEO options to setsockopt() take int values, in
milliseconds, on Windows. Not struct timeval. Eek. So passing a
struct timeval meant that the tv_sec value (which is first in the
struct) is interpreted as milliseconds. setsockopt apparently
doesn't even get upset by the fact that the option size doesn't
match the sizeof(int) it should expect.
One wonders what the Winsock designers were thinking when they reused
the same socket option names SO_RCVTIMEO and SO_SNDTIMEO, but changed
the type of the option value. Luckily I didn't find any other use of
SO_RCVTIMEO and SO_SNDTIMEO in the part of the GNOME stack that has
been ported to Windows. But if you happen to have some other source
code ported from Unix to Windows, it is a good idea to look for these
options and verify that they are used correctly.
--tml
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]