diff options
Diffstat (limited to 'vio')
-rw-r--r-- | vio/vio_priv.h | 4 | ||||
-rw-r--r-- | vio/viosocket.c | 9 | ||||
-rw-r--r-- | vio/viossl.c | 3 |
3 files changed, 11 insertions, 5 deletions
diff --git a/vio/vio_priv.h b/vio/vio_priv.h index 9a925a2c4c9..3a75a08021d 100644 --- a/vio/vio_priv.h +++ b/vio/vio_priv.h @@ -23,7 +23,7 @@ #include <m_string.h> #include <violite.h> -void vio_ignore_timeout(Vio *vio, uint timeout); +void vio_ignore_timeout(Vio *vio, uint which, uint timeout); #ifdef HAVE_OPENSSL #include "my_net.h" /* needed because of struct in_addr */ @@ -31,7 +31,7 @@ void vio_ignore_timeout(Vio *vio, uint timeout); void vio_ssl_delete(Vio* vio); int vio_ssl_read(Vio *vio,gptr buf, int size); int vio_ssl_write(Vio *vio,const gptr buf,int size); -void vio_ssl_timeout(Vio *vio, uint timeout); +void vio_ssl_timeout(Vio *vio, uint which, uint timeout); /* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible. */ int vio_ssl_fastsend(Vio *vio); diff --git a/vio/viosocket.c b/vio/viosocket.c index 77922594469..b6aa793f57b 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -318,11 +318,16 @@ my_bool vio_poll_read(Vio *vio,uint timeout) void vio_timeout(Vio *vio __attribute__((unused)), - uint timeout __attribute__((unused))) + uint which __attribute__((unused)), + uint timeout __attribute__((unused))) { #ifdef __WIN__ ulong wait_timeout= (ulong) timeout * 1000; - (void) setsockopt(vio->sd, SOL_SOCKET, SO_RCVTIMEO, (char*) &wait_timeout, + if (which == 0) + (void) setsockopt(vio->sd, SOL_SOCKET, SO_RCVTIMEO, (char*) &wait_timeout, + sizeof(wait_timeout)); + else + (void) setsockopt(vio->sd, SOL_SOCKET, SO_SNDTIMEO, (char*) &wait_timeout, sizeof(wait_timeout)); #endif /* __WIN__ */ } diff --git a/vio/viossl.c b/vio/viossl.c index 07713c83763..773d444063b 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -421,7 +421,8 @@ int vio_ssl_blocking(Vio * vio __attribute__((unused)), void vio_ssl_timeout(Vio *vio __attribute__((unused)), - uint timeout __attribute__((unused))) + uint which __attribute__((unused)), + uint timeout __attribute__((unused))) { /* Not yet implemented (non critical) */ } |