Fixed another instance of only checking for EAGAIN from a socket, from Ala-lala
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define PORT_WANT_ERRNO
|
||||||
|
#include "port.h"
|
||||||
#include "netmelee.h"
|
#include "netmelee.h"
|
||||||
#include "libs/alarm.h"
|
#include "libs/alarm.h"
|
||||||
#include "libs/callback.h"
|
#include "libs/callback.h"
|
||||||
@@ -197,7 +199,7 @@ flushPacketQueues(void) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
flushStatus = flushPacketQueue(conn);
|
flushStatus = flushPacketQueue(conn);
|
||||||
if (flushStatus == -1 && errno != EAGAIN)
|
if (flushStatus == -1 && errno != EAGAIN && errno != EWOULDBLOCK)
|
||||||
closePlayerNetworkConnection(player);
|
closePlayerNetworkConnection(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,8 +104,8 @@ queuePacket(NetConnection *conn, Packet *packet) {
|
|||||||
|
|
||||||
// If an error occurs during sending, we leave the unsent packets in
|
// If an error occurs during sending, we leave the unsent packets in
|
||||||
// the queue, and let the caller decide what to do with them.
|
// the queue, and let the caller decide what to do with them.
|
||||||
// This function may return -1 with errno EAGAIN if we're waiting for
|
// This function may return -1 with errno EAGAIN or EWOULDBLOCK
|
||||||
// the other party to act first.
|
// if we're waiting for the other party to act first.
|
||||||
static int
|
static int
|
||||||
flushPacketQueueLinks(NetConnection *conn, PacketQueueLink **first) {
|
flushPacketQueueLinks(NetConnection *conn, PacketQueueLink **first) {
|
||||||
PacketQueueLink *link;
|
PacketQueueLink *link;
|
||||||
|
|||||||
Reference in New Issue
Block a user