Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2003:
[Freeciv-Dev] (PR#3901) bug no. 3664
Home

[Freeciv-Dev] (PR#3901) bug no. 3664

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#3901) bug no. 3664
From: "Peter Zelezny" <pzel@xxxxxxxxxxx>
Date: Sun, 30 Mar 2003 03:38:33 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Hi,

Regarding this bug:

http://rt.freeciv.org/Ticket/Display.html?id=3664

I think this patch might be on the right track to fixing it. I havn't had
a chance to try it out (I havn't the resources).

Basically, you want to:

loop
{
        select(.., &write_fd, ....);    /* sernet.c */

        if(FD_IS_SET(socket, &write))
        {
                repeat  /* connection.c */
                {
                        nput = send(...);
                        if(nput == -1 && errno==EWOULDBLOCK)
                                break;
                }
        }
}

I think the second call to select() in connection.c is incorrect and
could block. Also, you shouldn't put sockets into write_fd unless there's
actually something in your queue to send, or select can keep returning
and loop (on some unix's it does this). I'm not sure if it does it or
not, just FYI.

-- 
Peter Zelezny.

Attachment: fc-1140-send.diff
Description: fc-1140-send.diff


[Prev in Thread] Current Thread [Next in Thread]