conn: avoid needlesly scary 'buffer overflow' messages
When the write buffer space grows too large, ngircd has to disconnect the client to avoid wasting too much memory. ngircd logs this with a scary 'write buffer overflow' message. Change this to a more descriptive wording.
This commit is contained in:
parent
c26ca7773b
commit
0bb892bb5f
|
@ -108,8 +108,8 @@ Zip_Buffer( CONN_ID Idx, const char *Data, size_t Len )
|
||||||
* otherwise the zip wbuf would grow too large */
|
* otherwise the zip wbuf would grow too large */
|
||||||
buflen = array_bytes(&My_Connections[Idx].zip.wbuf);
|
buflen = array_bytes(&My_Connections[Idx].zip.wbuf);
|
||||||
if (buflen + Len >= WRITEBUFFER_SLINK_LEN) {
|
if (buflen + Len >= WRITEBUFFER_SLINK_LEN) {
|
||||||
Log(LOG_ALERT, "Zip Write Buffer overflow: %lu bytes\n", buflen + Len);
|
Log(LOG_ALERT, "Zip Write buffer space exhausted: %lu bytes", buflen + Len);
|
||||||
Conn_Close(Idx, "Zip Write buffer overflow", NULL, false);
|
Conn_Close(Idx, "Zip Write buffer space exhausted", NULL, false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return array_catb(&My_Connections[Idx].zip.wbuf, Data, Len);
|
return array_catb(&My_Connections[Idx].zip.wbuf, Data, Len);
|
||||||
|
@ -158,7 +158,7 @@ Zip_Flush( CONN_ID Idx )
|
||||||
if (out->avail_out <= 0) {
|
if (out->avail_out <= 0) {
|
||||||
/* Not all data was compressed, because data became
|
/* Not all data was compressed, because data became
|
||||||
* bigger while compressing it. */
|
* bigger while compressing it. */
|
||||||
Log (LOG_ALERT, "Compression error: buffer overvlow!?");
|
Log(LOG_ALERT, "Compression error: buffer overflow!?");
|
||||||
Conn_Close(Idx, "Compression error!", NULL, false);
|
Conn_Close(Idx, "Compression error!", NULL, false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -972,10 +972,10 @@ Conn_Write( CONN_ID Idx, char *Data, size_t Len )
|
||||||
if (array_bytes(&My_Connections[Idx].wbuf) + Len >=
|
if (array_bytes(&My_Connections[Idx].wbuf) + Len >=
|
||||||
writebuf_limit) {
|
writebuf_limit) {
|
||||||
Log(LOG_NOTICE,
|
Log(LOG_NOTICE,
|
||||||
"Write buffer overflow (connection %d, limit is %lu bytes, %lu bytes new, %lu bytes pending)!",
|
"Write buffer space exhausted (connection %d, limit is %lu bytes, %lu bytes new, %lu bytes pending)",
|
||||||
Idx, writebuf_limit, Len,
|
Idx, writebuf_limit, Len,
|
||||||
(unsigned long)array_bytes(&My_Connections[Idx].wbuf));
|
(unsigned long)array_bytes(&My_Connections[Idx].wbuf));
|
||||||
Conn_Close(Idx, "Write buffer overflow!", NULL, false);
|
Conn_Close(Idx, "Write buffer space exhausted", NULL, false);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1525,9 +1525,9 @@ Read_Request( CONN_ID Idx )
|
||||||
{
|
{
|
||||||
/* Read buffer is full */
|
/* Read buffer is full */
|
||||||
Log(LOG_ERR,
|
Log(LOG_ERR,
|
||||||
"Receive buffer overflow (connection %d): %d bytes!",
|
"Receive buffer space exhausted (connection %d): %d bytes",
|
||||||
Idx, array_bytes(&My_Connections[Idx].rbuf));
|
Idx, array_bytes(&My_Connections[Idx].rbuf));
|
||||||
Conn_Close( Idx, "Receive buffer overflow!", NULL, false );
|
Conn_Close(Idx, "Receive buffer space exhausted", NULL, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1563,7 +1563,7 @@ Read_Request( CONN_ID Idx )
|
||||||
Log(LOG_ERR,
|
Log(LOG_ERR,
|
||||||
"Could not append recieved data to zip input buffer (connn %d): %d bytes!",
|
"Could not append recieved data to zip input buffer (connn %d): %d bytes!",
|
||||||
Idx, len);
|
Idx, len);
|
||||||
Conn_Close(Idx, "Receive buffer overflow!", NULL,
|
Conn_Close(Idx, "Receive buffer space exhausted", NULL,
|
||||||
false);
|
false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1572,7 +1572,7 @@ Read_Request( CONN_ID Idx )
|
||||||
{
|
{
|
||||||
if (!array_catb( &My_Connections[Idx].rbuf, readbuf, len)) {
|
if (!array_catb( &My_Connections[Idx].rbuf, readbuf, len)) {
|
||||||
Log( LOG_ERR, "Could not append recieved data to input buffer (connn %d): %d bytes!", Idx, len );
|
Log( LOG_ERR, "Could not append recieved data to input buffer (connn %d): %d bytes!", Idx, len );
|
||||||
Conn_Close( Idx, "Receive buffer overflow!", NULL, false );
|
Conn_Close(Idx, "Receive buffer space exhausted", NULL, false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue