[IRCServices] Patch: Flush write buffer on connect

Alexander Barton alex at barton.de
Fri Nov 21 02:05:37 PST 2008


Hi Andrew!

Thanks a lot for your answer!
I don't want to stress anybody, but was not sure if the mail reached  
its destination :-)

Regards
Alex

Am 21.11.2008 um 03:48 schrieb Andrew Church:

> Sorry, I'm busy with work at the moment and don't have the time to
> investigate the issue in detail.  I'll take a closer look when I do
> have time.
>
>  --Andrew Church
>    achurch at achurch.org
>    http://achurch.org/
>
>> Hi all!
>>
>> Any comments to this patch?
>>
>> Regards
>> Alex
>>
>> Am 11.11.2008 18:14, Alexander Barton schrieb:
>>
>>> Hi!
>>>
>>> The attached patch fixes the problem that IRCServices don't flush  
>>> the
>>> write buffer when the connection to the server is establised and  
>>> data
>>> has already been written to the buffer.
>>>
>>> This caused the server to disconnect IRCServices after a timeout
>>> because of no data has been sent. Solution has been to send
>>> IRCServices a HUP signal right after starting it. I was able to
>>> reproduce this problem on all of my machines (Linux on HPPA, Linux  
>>> on
>>> amd64, and Mac OS X on i386).
>>>
>>> I think these messages describe the same problem:
>>> <http://lists.ircservices.za.net/pipermail/ircservices/2007/005283.html 
>>> >
>>> <http://lists.ircservices.za.net/pipermail/ircservices/2007/005288.html 
>>> >
>>> <http://lists.ircservices.za.net/pipermail/ircservices/2007/005318.html 
>>> >
>>> <http://lists.ircservices.za.net/pipermail/ircservices/2007/005319.html 
>>> >
>>> <http://lists.ircservices.za.net/pipermail/ircservices/2007/005287.html 
>>> >
>>>
>>> Regards
>>> Alex
>>>
>>>
>>> diff -rup ircservices-5.1.13-orig/sockets.c ircservices-5.1.13/ 
>>> sockets.c
>>> --- ircservices-5.1.13-orig/sockets.c	2008-11-07 18:11:57.000000000
>>> +0100
>>> +++ ircservices-5.1.13/sockets.c	2008-11-09 15:53:35.000000000 +0100
>>> @@ -691,6 +691,10 @@ void check_sockets(void)
>>>                 }
>>>                 s->flags &= ~SF_CONNECTING;
>>>                 s->flags |= SF_CONNECTED;
>>> +
>>> +		/* Flush already cached data for this socket */
>>> +		flush_write_buffer(s);
>>> +
>>>                 FD_CLR(i, &write_fds);
>>>                 if (!(s->flags & SF_MUTE))
>>>                     FD_SET(i, &sock_fds);
>>>
>>
>>
>> ------------------------------------------------------------------
>> To unsubscribe or change your subscription options, visit:
>> http://lists.ircservices.za.net/mailman/listinfo/ircservices
> ------------------------------------------------------------------
> To unsubscribe or change your subscription options, visit:
> http://lists.ircservices.za.net/mailman/listinfo/ircservices