ianthetechie / SwiftCGI

An object-functional microframework for developing FCGI applications in Swift
Other
97 stars 11 forks source link

Determine why low-level callbacks are receiving invalid arguments #15

Closed ianthetechie closed 9 years ago

ianthetechie commented 9 years ago

socketDidDisconnect and handleRecord are both called fairly frequently with invalid arguments. It is easy to reproduce the condition while doing a bunch of rapid refreshes, but the condition also appears fairly regularly under normal use.

Example log:

Started SwiftCGI server on port 9000
2015-02-19 01:42:49.990 SwiftCGI Demo[23579:3022225] Bartender: Loaded BartenderHelperSeventyEight
2015-02-19 01:43:41.756 SwiftCGI Demo[23579:3023614] WARNING: nil sock disconnect
2015-02-19 01:43:44.706 SwiftCGI Demo[23579:3023615] WARNING: nil sock disconnect
ianthetechie commented 9 years ago

Fixed in 66d2074481cb12a14c5e1e730a2ceb0ed57c564b. The issue was the sockets were not being strongly referenced after acceptance. This caused a problem for persistent connections that attempted to take advantage of pipelining after a delay.