Revision: 14866
Author:   adrian.chadd
Date:     Sat Jul  9 01:45:26 2011
Log: Don't remove the comm handler or clear the FD events if there's no FD.


http://code.google.com/p/lusca-cache/source/detail?r=14866

Modified:
 /playpen/LUSCA_HEAD_ipv6/src/comm2.c

=======================================
--- /playpen/LUSCA_HEAD_ipv6/src/comm2.c        Sat Jul  2 19:52:47 2011
+++ /playpen/LUSCA_HEAD_ipv6/src/comm2.c        Sat Jul  9 01:45:26 2011
@@ -215,10 +215,12 @@
     CNCB *callback = cs->callback;
     void *data = cs->data;
     int fd = cs->fd;
-    comm_remove_close_handler(fd, commConnectFree, cs);
+    if (fd != -1) {
+        comm_remove_close_handler(fd, commConnectFree, cs);
+        commSetTimeout(fd, -1, NULL, NULL);
+    }
     cs->callback = NULL;
     cs->data = NULL;
-    commSetTimeout(fd, -1, NULL, NULL);
     if (status != COMM_OK) {
         if (fd != -1)
             comm_close(fd);
@@ -226,7 +228,7 @@
     }
     commConnectFree(fd, cs);
     if (cbdataValid(data))
-       callback(fd, status, data);
+        callback(fd, status, data);
     cbdataUnlock(data);
 }

--
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en.

Reply via email to