[or-cvs] r10908: bugfixes (libevent-urz/trunk)

Urz at seul.org Urz at seul.org
Sun Jul 22 23:34:38 UTC 2007


Author: Urz
Date: 2007-07-22 19:34:37 -0400 (Sun, 22 Jul 2007)
New Revision: 10908

Modified:
   libevent-urz/trunk/event.h
   libevent-urz/trunk/win_evbuffer.c
Log:
bugfixes

Modified: libevent-urz/trunk/event.h
===================================================================
--- libevent-urz/trunk/event.h	2007-07-22 22:56:33 UTC (rev 10907)
+++ libevent-urz/trunk/event.h	2007-07-22 23:34:37 UTC (rev 10908)
@@ -46,6 +46,7 @@
 typedef unsigned char u_char;
 typedef unsigned short u_short;
 #else
+#include <sys/types.h>
 #include <sys/socket.h>
 #endif
 

Modified: libevent-urz/trunk/win_evbuffer.c
===================================================================
--- libevent-urz/trunk/win_evbuffer.c	2007-07-22 22:56:33 UTC (rev 10907)
+++ libevent-urz/trunk/win_evbuffer.c	2007-07-22 23:34:37 UTC (rev 10908)
@@ -63,7 +63,16 @@
     evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg) {
     
     struct sa_bufferevent *new;
+    int gsoRet;
+    DWORD connTime;
+    int size = sizeof(DWORD);
     
+    gsoRet = getsockopt((SOCKET) fd, SOL_SOCKET, SO_CONNECT_TIME, &connTime, &size);
+    /* Socket is not connected */
+    if(gsoRet == SOCKET_ERROR) {
+        return -1;
+    }
+    
     if(!IOCPinit) {
         IOCPLoaderInit();
         IOCPinit = 1;



More information about the tor-commits mailing list