fixed lag bug in client-ssl patch

Joshua Kwan joshk at
Wed Apr 20 21:24:33 EDT 2005


Stephen Shirley wrote:
> Hi,
>     Didn't know if i should file an official bug with debian as
> client-ssl isn't enabled by default. Anyway, after months of soul
> crushing lag, i found the problem.

You are a god among men. If I were 21, I'd buy you enough beer to last a

CC:ing this reply to the Hybrid user/developer list - many people have
been searching for a solution to this problem.

I'll see how it applies to 7.1-CURRENT, but this is definitely a huge
step in the right direction. Thank you thank you thank you!

Including the rest of the message for the list's benefit:

>     Basically, tcp is a bitstream, ssl isn't. Ssl sends data over tcp in
> chunks it calls records. SSL_read() will only return data whenever a
> full record has been recieved and decrypted. The lag problem occurred
> when multiple records arrived at once. The sigio comms handler would
> only get one read signal, read_packet() only call SSL_read() once,
> returning the first record. The rest would sit in the input buffer until
> another packet arrived, at which time the oldest record would be read
> in, with all the others still being left in the buffer.
>     To fix this, I've changed read_packet() so that at the end of the
> function it checks to see if there was an error returned from
> SSL_read(). If not, then it returned a record, which was then queued.
> This means there may still be more records waiting to be read in. In
> that case, i call read_packet() again. If/when SSL_read() returns with
> an error, there's either no more full records to be read, or some other
> error has occurred. In either case, it's time to return from the function.
> The above url contains the source and binary .debs, and the patch that
> i've written. If you have any other questions, i'd be happy to answer them.
> Btw, if you want someone to help out with ircd-hybrid, i'd be more than
> happy to do what i can.
> Steve

Joshua Kwan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 948 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the hybrid mailing list