Spritetm / libesphttpd

NOTE: THIS CODE IS UNMAINTAINED. Please take a look at https://github.com/chmorgan/libesphttpd instead.
125 stars 109 forks source link

Connection not cleaning up? #8

Closed denniedegroot closed 8 years ago

denniedegroot commented 8 years ago

I am experiencing some strange behavior with the latest code. When I use Google chrome on Linux and request multiple CGI calls the connections do not seem te get properly closed. When I revert back to commit e993e36 everything is working again. I attached the log of what is happening on the ESP.

Firefox and Safari seem to work fine with the latest code. I will do some more investigation in the weekend.

Pool slot 0 is done. Cleaning up for next req Conn req from 192.168.1.249:40532, using pool slot 1 Conn req from 192.168.1.249:40533, using pool slot 2 Conn req from 192.168.1.249:40534, using pool slot 3 Conn req from 192.168.1.249:40535, using pool slot 4 URL = /api/wifi/info Is url index 0 Is url index 11 Is url index 19 Conn req from 192.168.1.249:40536, using pool slot 5 Pool slot 1 is done. Cleaning up for next req URL = /api/wifi/info Is url index 0 Is url index 11 Is url index 19 Pool slot 2 is done. Cleaning up for next req URL = /api/wifi/info Is url index 0 Is url index 11 Is url index 19 Pool slot 3 is done. Cleaning up for next req URL = /api/wifi/info Is url index 0 Is url index 11 Is url index 19 Pool slot 4 is done. Cleaning up for next req URL = /api/wifi/info Is url index 0 Is url index 11 Is url index 19 Pool slot 5 is done. Cleaning up for next req Conn req from 192.168.1.249:40538, using pool slot 6 URL = /api/wifi/info Is url index 0 Is url index 11 Is url index 19 Pool slot 6 is done. Cleaning up for next req Conn req from 192.168.1.249:40539, using pool slot 7 URL = /api/wifi/info Is url index 0 Is url index 11 Is url index 19 Pool slot 7 is done. Cleaning up for next req Conn req from 192.168.1.249:40540, using pool slot 8 Aiee, conn pool overflow! * Unknown connection 192.168.1.249:40540 Conn req from 192.168.1.249:40541, using pool slot 8 Aiee, conn pool overflow! * Unknown connection 192.168.1.249:40541 Conn req from 192.168.1.249:40542, using pool slot 8 Aiee, conn pool overflow! *\ Unknown connection 192.168.1.249:40542

Spritetm commented 8 years ago

Hmm, seems either Chrome doesn't disconnect its sockets for some reason, or the disconnect callback in esphttpd is messed up. I'll investigate.

Spritetm commented 8 years ago

Can you try a38909a ? That should fix this bug too.

denniedegroot commented 8 years ago

The fix resolved the issue! Awesome :)