X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fconn.c;h=e73dd3060e9d51887f21a610418c34b408e4c7f6;hp=032a6e91e08b83f41bfd220ad8d527ddeb76f6c1;hb=03628dbeaf40a9de34b3eb6d5bf6dd34eed8248c;hpb=493ccd57f41bea8c9bca5311ca597b37fadc9e7f diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index 032a6e91..e73dd306 100644 --- a/src/ngircd/conn.c +++ b/src/ngircd/conn.c @@ -7,8 +7,6 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * Please read the file COPYING, README and AUTHORS for more information. - * - * Connection management */ @@ -18,6 +16,11 @@ #include "conf-ssl.h" #include "io.h" +/** + * @file + * Connection management + */ + #include "imp.h" #include #ifdef PROTOTYPES @@ -858,7 +861,7 @@ static bool Conn_Write( CONN_ID Idx, char *Data, size_t Len ) { CLIENT *c; - size_t writebuf_limit = WRITEBUFFER_LEN; + size_t writebuf_limit = WRITEBUFFER_MAX_LEN; assert( Idx > NONE ); assert( Data != NULL ); assert( Len > 0 ); @@ -894,7 +897,7 @@ Conn_Write( CONN_ID Idx, char *Data, size_t Len ) /* Uncompressed link: * Check if outbound buffer has enough space for the data. */ if (array_bytes(&My_Connections[Idx].wbuf) + Len >= - writebuf_limit) { + WRITEBUFFER_FLUSH_LEN) { /* Buffer is full, flush it. Handle_Write deals with * low-level errors, if any. */ if (!Handle_Write(Idx)) @@ -906,8 +909,8 @@ Conn_Write( CONN_ID Idx, char *Data, size_t Len ) if (array_bytes(&My_Connections[Idx].wbuf) + Len >= writebuf_limit) { Log(LOG_NOTICE, - "Write buffer overflow (connection %d, size %lu byte)!", - Idx, + "Write buffer overflow (connection %d, limit is %lu bytes, %lu bytes new, %lu bytes pending)!", + Idx, writebuf_limit, Len, (unsigned long)array_bytes(&My_Connections[Idx].wbuf)); Conn_Close(Idx, "Write buffer overflow!", NULL, false); return false;