ElementalAlchemist / txircd

Modular IRCd built using Twisted. Made to be extremely customizable.
BSD 3-Clause "New" or "Revised" License
19 stars 5 forks source link

The Z:line command reports a broken pipe on disconnect instead of the ban reason #63

Closed Heufneutje closed 10 years ago

Heufneutje commented 10 years ago

I just remembered we still have this problem so I decided to make an issue for it to make sure we won't forget.

ekimekim commented 10 years ago

A broken pipe error generally means that you tried to write to a socket that was closed at the other end. Perhaps you're sending a QUIT, the client is disconnecting, then you're sending more info?

Heufneutje commented 10 years ago

It's a bug in the core I think. Z:lines trigger on the "connect" action rather than "register" like the other X:lines do. Disconnects happen in the exact same way, yet they show as broken pipes. The NOTICE that tells you you're banned doesn't get sent either so the connection is being terminated before it's fully established. That's just my guess though.

Heufneutje commented 10 years ago

I have determined the cause of this and it is indeed caused by the connection being closed too fast. However, I can't think of a good way to slightly delay that process.

ElementalAlchemist commented 10 years ago

I think this is a Twisted thing, where connectionMade is called before the connection is fully set up. I made a reasonable attempt at solving this issue in 57ab753f9548d3b7453b287b1a2415d7eb7be227. It seems to work at least for z:lines for me. Please verify.

Heufneutje commented 10 years ago

Tested it with Z:lines and connlimit and both seem to work fine now so I'm closing this one.