Commit Diff
Diff:
07d8da60deb7a788fa0446ccb52a65348376677c
5930a29197d9b45ce4e09d7c02aa7da3e2400272
Commit:
5930a29197d9b45ce4e09d7c02aa7da3e2400272
Tree:
0767cbd0734aaf3da959c19b056a19ef89826bd4
Author:
Alexander Barton <alex@barton.de>
Committer:
Alexander Barton <alex@barton.de>
Date:
Thu May 17 15:16:47 2007 UTC
Message:
Zip_Flush(): close the connection in all error cases.
blob - 5ac8323419f2b12b16ac04ae2fb0b24f93f3deb0
blob + f162d2bc90e9a1ac3b72ed3854d4dae39b490360
--- src/ngircd/conn-zip.c
+++ src/ngircd/conn-zip.c
@@ -22,7 +22,7 @@
/* enable more zlib related debug messages: */
/* #define DEBUG_ZLIB */
-static char UNUSED id[] = "$Id: conn-zip.c,v 1.14 2007/05/17 14:46:14 fw Exp $";
+static char UNUSED id[] = "$Id: conn-zip.c,v 1.15 2007/05/17 15:16:47 alex Exp $";
#include "imp.h"
#include <assert.h>
@@ -159,8 +159,11 @@ Zip_Flush( CONN_ID Idx )
Log(LOG_DEBUG, "zipbuf_used: %d", zipbuf_used);
#endif
if (!array_catb(&My_Connections[Idx].wbuf,
- (char *)zipbuf, (size_t) zipbuf_used))
+ (char *)zipbuf, (size_t) zipbuf_used)) {
+ Log (LOG_ALERT, "Compression error: can't copy data!?");
+ Conn_Close(Idx, "Compression error!", NULL, false);
return false;
+ }
My_Connections[Idx].bytes_out += zipbuf_used;
My_Connections[Idx].zip.bytes_out += array_bytes(&My_Connections[Idx].zip.wbuf);
IRCNow