celluloid / reel

UNMAINTAINED: See celluloid/celluloid#779 - Celluloid::IO-powered web server
https://celluloid.io
MIT License
596 stars 87 forks source link

Remove optimize function #158

Closed czaks closed 9 years ago

czaks commented 9 years ago

This function is only used by the servers. Except... it is wrapped with this code:

if socket.is_a? TCPSocket

Obviously, TCPSocket refers to C::IO::TCPSocket and not to ::TCPSocket. In the both servers' contexts, things to optimize are: Celluloid::IO::TCPServer. C::IO::TCPServer is not a C::IO::TCPSocket, nor it subclasses one, so the code never evaluates.

After some talk with @tarcieri on IRC, he told me, that the function doesn't make sense on a listener (ie. server) socket. And it isn't used in any other context.

Thus, the pull request just removes unused code.

tarcieri commented 9 years ago

Indeed! Disabling Nagle on a server's listen socket probably isn't going to do a whole hell of a lot :wink: