pidgin: 594499c2: a patch from eperez that corrects EOF de...

Eduardo Pérez Ureta eperez at users.sourceforge.net
Thu Dec 18 10:44:43 EST 2008


2008-12-18 Mark Schneider <queueram at gmail.com>:
> On Thu, Dec 18, 2008 at 01:31,  <khc at pidgin.im> wrote:
>> -----------------------------------------------------------------
>> Revision: 594499c2962474322f63d0dea4c16760a2f764f6
>> Ancestor: 4b199542a64ade94d38f23bd0907fdb7d35c2269
>> Author: khc at pidgin.im
>> Date: 2008-12-18T07:25:37
>> Branch: im.pidgin.pidgin
>> URL: http://d.pidgin.im/viewmtn/revision/info/594499c2962474322f63d0dea4c16760a2f764f6
>>
>> Modified files:
>>        libpurple/protocols/msn/soap.c
>>        libpurple/protocols/msnp9/nexus.c
>>
>> ChangeLog:
>>
>> a patch from eperez that corrects EOF detection, Fixes #7726
>>
>>
>> ============================================================
>> --- libpurple/protocols/msn/soap.c      a0d0310469dff2036b06d60b54b06db0b11ea595
>> +++ libpurple/protocols/msn/soap.c      471109ac485058a9b0dce16f874080883b214c89
>> @@ -521,7 +521,7 @@ msn_soap_read_cb(gpointer data, gint fd,
>>        /* msn_soap_process could alter errno */
>>        msn_soap_process(conn);
>>
>> -       if (cnt < 0 && perrno != EAGAIN) {
>> +       if (cnt < 0 && perrno != EAGAIN || cnt == 0) {
>>                /* It's possible msn_soap_process closed the ssl connection */
>>                if (conn->ssl) {
>>                        purple_ssl_close(conn->ssl);
>> ============================================================
> <snip>
>
> Sorry if i'm being picky, but i think it would be more clear if that were:
> if (cnt <= 0 && perrno != EAGAIN) {

In most cases you should not even check the value of perrno when the
returned value (cnt) equals 0 as it is supposed to be undefined.

I think my original patch is the most clear.

Eduardo




More information about the Devel mailing list