]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 1991: kqueue causes SSL to hang
authorMing Fu <mfu@watchguard.com>
Thu, 23 May 2013 02:26:18 +0000 (20:26 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 23 May 2013 02:26:18 +0000 (20:26 -0600)
commit3af4eb38cf46a7836f747a4ecfbd93630323484a
tree762eded7bdc86f9fb74bc9d8c6073cdd9f3afb86
parentb7a7e8e9b9c745c7b04760a83d4574269c575771
Bug 1991: kqueue causes SSL to hang

Compare the code in normal select and epoll v.s. kqueue. The select use a 0
wait time to get out of select wait in order to handle a list of read_pendings.
However, epoll add the read_pending to read and write event monitor. At a first
look, this seems strange as why read pending has anything to do with write. It
became obvious when the write ready event is triggered. During a write ready
event, if read_pending is on, the read callback is called before the write
callback. As the write buffer is unlikely to be full for an extended period, a
write callback is guaranteed in the immediate future for the read_pending
socket by waiting on write.

The patch follows that same logic as epoll and applies it on kqueue.
src/comm/ModKqueue.cc