Changeset 728 for branches/ithildin-1.1


Ignore:
Timestamp:
05/12/06 00:36:30 (6 years ago)
Author:
wd
Message:

Update some commentary, request a client sendq flush when the connection is
closed

Location:
branches/ithildin-1.1/modules/ircd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ithildin-1.1/modules/ircd/client.c

    r717 r728  
    114114            ircd.stats.serv.unkclients--; 
    115115        cli->conn->cli = NULL; 
    116         destroy_connection(cli->conn, msg); 
     116 
     117        /* If sendq_flush does not close the connection for us (it will 
     118         * return 0 if it does) then close the connection.  This ensures 
     119         * that we do best-effort work on dumping the last dribbly bits of 
     120         * the sendq out to the client if we can.  We do not try hard to 
     121         * make this work, though! */ 
     122        if (sendq_flush(cli->conn)) 
     123            destroy_connection(cli->conn, msg); 
    117124    } 
    118125 
  • branches/ithildin-1.1/modules/ircd/connection.c

    r723 r728  
    4747    /* Try to send them an error message if we can.  We assume someone has 
    4848     * tried to flush their sendq or doesn't think we should, so if it's 
    49      * empty we send an error, otherwise we clean it off... */ 
     49     * empty we send an error, otherwise we clean it off and don't bother 
     50     * trying to send since other sends have already failed (and we infer 
     51     * that this means the socket is not writeable) */ 
    5052    if (STAILQ_EMPTY(&c->sendq) && reason != NULL && *reason != '\0') { 
    5153        snprintf(msg, 512, "\r\nERROR :Closing Link: %s (%s)\r\n",  
  • branches/ithildin-1.1/modules/ircd/server.c

    r703 r728  
    117117    } 
    118118 
    119     /* if this server is ours, we have to close the connection.  also, we 
    120      * should try as best we can to flush the buffer.  this probably won't work 
    121      * very well, but we take a stab at it. */ 
     119    /* If this server is ours we have to close the connection.  We try first 
     120     * to flush the sendq.  If sendq_flush returns 0 it has closed the 
     121     * connection for us (socket error), otherwise we close it ourself. */ 
    122122    if (MYSERVER(srv)) { 
    123         if (sendq_flush(srv->conn)) { 
    124             srv->conn->srv = NULL; 
     123        srv->conn->srv = NULL; 
     124        if (sendq_flush(srv->conn)) 
    125125            destroy_connection(srv->conn, msg); 
    126         } 
    127126    } 
    128127 
Note: See TracChangeset for help on using the changeset viewer.