fix handling of empty requests

This commit is contained in:
Florian Westphal 2005-08-27 23:42:23 +00:00
parent e728bd2e1a
commit a2cdc08c39
1 changed files with 5 additions and 1 deletions

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.171 2005/08/27 23:33:11 alex Exp $"; static char UNUSED id[] = "$Id: conn.c,v 1.172 2005/08/27 23:42:23 fw Exp $";
#include "imp.h" #include "imp.h"
#include <assert.h> #include <assert.h>
@ -1214,6 +1214,10 @@ Handle_Buffer( CONN_ID Idx )
return false; return false;
} }
if (len < 3) { /* request was empty (only '\r\n') */
array_trunc(&My_Connections[Idx].rbuf);
break;
}
#ifdef ZLIB #ifdef ZLIB
/* remember if stream is already compressed */ /* remember if stream is already compressed */
old_z = My_Connections[Idx].options & CONN_ZIP; old_z = My_Connections[Idx].options & CONN_ZIP;