1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-10-28 04:46:17 +00:00

"Enhanced" debug message for Handle_Write(), only print when data in buffer.

This commit is contained in:
Alexander Barton 2006-07-23 15:22:56 +00:00
parent 0d5fc770d3
commit 9a2d4eef44

View File

@ -17,7 +17,7 @@
#include "portab.h" #include "portab.h"
#include "io.h" #include "io.h"
static char UNUSED id[] = "$Id: conn.c,v 1.196 2006/05/12 11:53:04 alex Exp $"; static char UNUSED id[] = "$Id: conn.c,v 1.197 2006/07/23 15:22:56 alex Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@ -845,9 +845,8 @@ Handle_Write( CONN_ID Idx )
} }
assert( My_Connections[Idx].sock > NONE ); assert( My_Connections[Idx].sock > NONE );
LogDebug("Handle_Write() called for connection %d ...", Idx);
wdatalen = array_bytes(&My_Connections[Idx].wbuf ); wdatalen = array_bytes(&My_Connections[Idx].wbuf );
#ifdef ZLIB #ifdef ZLIB
if (wdatalen == 0 && !array_bytes(&My_Connections[Idx].zip.wbuf)) { if (wdatalen == 0 && !array_bytes(&My_Connections[Idx].zip.wbuf)) {
io_event_del(My_Connections[Idx].sock, IO_WANTWRITE ); io_event_del(My_Connections[Idx].sock, IO_WANTWRITE );
@ -867,6 +866,9 @@ Handle_Write( CONN_ID Idx )
/* Zip_Flush() may have changed the write buffer ... */ /* Zip_Flush() may have changed the write buffer ... */
wdatalen = array_bytes(&My_Connections[Idx].wbuf); wdatalen = array_bytes(&My_Connections[Idx].wbuf);
LogDebug
("Handle_Write() called for connection %d, %ld bytes pending ...",
Idx, wdatalen);
len = write(My_Connections[Idx].sock, len = write(My_Connections[Idx].sock,
array_start(&My_Connections[Idx].wbuf), wdatalen ); array_start(&My_Connections[Idx].wbuf), wdatalen );