version 1.2 | | version 1.3 |
---|
| | |
| | |
/* | | /* |
* static char *rcsid_item_c = | | * static char *rcsid_item_c = |
* "$Id: item.c,v 1.2 2000/05/23 07:06:32 cvs Exp $"; | | * "$Id: item.c,v 1.3 2000/05/24 05:48:51 cvs Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
#include <newserver.h> | | #include <newserver.h> |
#include <sproto.h> | | #include <sproto.h> |
| | |
| | /* This is the maximum number of bytes we expect any one item to take up */ |
| | #define MAXITEMLEN 300 |
| | |
/******************************************************************************* | | /******************************************************************************* |
* | | * |
| | |
add_stringlen_to_sockbuf(query_short_name(tmp), &sl); | | add_stringlen_to_sockbuf(query_short_name(tmp), &sl); |
got_one++; | | got_one++; |
SET_FLAG(tmp, FLAG_CLIENT_SENT); | | SET_FLAG(tmp, FLAG_CLIENT_SENT); |
if (sl.len > (MAXSOCKBUF-250)) { | | if (sl.len > (MAXSOCKBUF-MAXITEMLEN)) { |
Send_With_Handling(&pl->contr->socket, &sl); | | Send_With_Handling(&pl->contr->socket, &sl); |
strcpy((char*)sl.buf,"item "); | | strcpy((char*)sl.buf,"item "); |
sl.len=strlen((char*)sl.buf); | | sl.len=strlen((char*)sl.buf); |
| | |
* items (especially with some of the bags out there) to | | * items (especially with some of the bags out there) to |
* overflow the buffer. IF so, send multiple item1 commands. | | * overflow the buffer. IF so, send multiple item1 commands. |
*/ | | */ |
if (sl.len > (MAXSOCKBUF-250)) { | | if (sl.len > (MAXSOCKBUF-MAXITEMLEN)) { |
Send_With_Handling(&pl->contr->socket, &sl); | | Send_With_Handling(&pl->contr->socket, &sl); |
strcpy((char*)sl.buf,"item1 "); | | strcpy((char*)sl.buf,"item1 "); |
sl.len=strlen((char*)sl.buf); | | sl.len=strlen((char*)sl.buf); |