+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.
+
2008-05-02 Dan Winship <danw@gnome.org>
* libsoup/soup-cookie.c (soup_cookie_applies_to_uri): fix the path
set_fdflags (SoupSocketPrivate *priv)
{
int opt;
- struct timeval timeout;
#ifndef G_OS_WIN32
+ struct timeval timeout;
int flags;
#endif
setsockopt (priv->sockfd, SOL_SOCKET,
SO_REUSEADDR, (void *) &opt, sizeof (opt));
+#ifndef G_OS_WIN32
timeout.tv_sec = priv->timeout;
timeout.tv_usec = 0;
setsockopt (priv->sockfd, SOL_SOCKET,
timeout.tv_usec = 0;
setsockopt (priv->sockfd, SOL_SOCKET,
SO_SNDTIMEO, (void *) &timeout, sizeof (timeout));
+#else
+ if (priv->timeout < G_MAXINT / 1000)
+ opt = priv->timeout * 1000;
+ else
+ opt = 0;
+
+ setsockopt (priv->sockfd, SOL_SOCKET,
+ SO_RCVTIMEO, (void *) &opt, sizeof (opt));
+
+ setsockopt (priv->sockfd, SOL_SOCKET,
+ SO_SNDTIMEO, (void *) &opt, sizeof (opt));
+#endif
#ifndef G_OS_WIN32
priv->iochannel =