[ENet-discuss] possible enet bug

eye at dihalt.com eye at dihalt.com
Wed Jul 23 04:55:40 PDT 2008


Hello

I just found that no ENET_EVENT_TYPE_DISCONNECT will be
returned by enet_host_process() if enet_peer_disconnect()
is called while peer is not yet connected ( in process of
connection )

the problem line: peer.c:446
suggested fix: peer.c:446

    if (peer -> state == ENET_PEER_STATE_CONNECTED || peer
-> state == ENET_PEER_STATE_DISCONNECT_LATER)
      peer -> state = ENET_PEER_STATE_DISCONNECTING;
    else
    {
        enet_host_flush (peer -> host);
-        enet_peer_reset (peer);
+        peer->state = ENET_PEER_STATE_ZOMBIE;
    }

Is this correct?


More information about the ENet-discuss mailing list