Search squid archive

RE: bug 1991/1939 and kqueue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Here is a patch for bug 1991 on FreeBSD compiled with kqueue. It fixed the websites that previously won't load through sslbump on FreeBSD with kqueue enabled.


--- /home/fming/work/squid-3.1.12.1-20110506/src/comm_kqueue.cc 2011-05-06 00:27:39.000000000 -0400
+++ comm_kqueue.cc      2011-05-12 10:03:49.000000000 -0400
@@ -198,7 +198,11 @@
     assert(F->flags.open);
 
     if (type & COMM_SELECT_READ) {
+        if (F->flags.read_pending)
+            kq_update_events(fd, EVFILT_WRITE, handler);
+ 
         kq_update_events(fd, EVFILT_READ, handler);
+        
         F->read_handler = handler;
         F->read_data = client_data;
     }
@@ -291,31 +295,24 @@
             continue;        /* XXX! */
         }
 
-        switch (ke[i].filter) {
-
-        case EVFILT_READ:
-
+        if (ke[i].filter == EVFILT_READ || F->flags.read_pending) {
             if ((hdl = F->read_handler) != NULL) {
                 F->read_handler = NULL;
                 F->flags.read_pending = 0;
                 hdl(fd, F->read_data);
             }
+        }
 
-            break;
-
-        case EVFILT_WRITE:
-
+        if (ke[i].filter == EVFILT_WRITE) {
             if ((hdl = F->write_handler) != NULL) {
                 F->write_handler = NULL;
                 hdl(fd, F->write_data);
             }
+        }
 
-            break;
-
-        default:
-            /* Bad! -- adrian */
+        if (ke[i].filter != EVFILT_WRITE && ke[i].filter != EVFILT_READ) {
+                /* Bad! -- adrian */
             debugs(5, 1, "comm_select: kevent returned " << ke[i].filter << "!");
-            break;
         }
     }






[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux