version 1.44 | | version 1.45 |
---|
| | |
| | |
/* | | /* |
* static char *rcsid_loop_c = | | * static char *rcsid_loop_c = |
* "$Id: loop.c,v 1.44 2006/05/18 05:27:44 mwedel Exp $"; | | * "$Id: loop.c,v 1.45 2006/05/21 10:35:11 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* or no more characters to read. | | * or no more characters to read. |
*/ | | */ |
do { | | do { |
if (ns->inbuf.len >= MAXSOCKBUF-1) { | | if (ns->inbuf.len >= MAXSOCKRECVBUF-1) { |
ns->status = Ns_Dead; | | ns->status = Ns_Dead; |
LOG(llevDebug, "Old input socket sent too much data without newline\n"); | | LOG(llevDebug, "Old input socket sent too much data without newline\n"); |
return; | | return; |
| | |
handle_oldsocket(ns); | | handle_oldsocket(ns); |
return; | | return; |
} | | } |
i=SockList_ReadPacket(ns->fd, &ns->inbuf, MAXSOCKBUF-1); | | i=SockList_ReadPacket(ns->fd, &ns->inbuf, MAXSOCKRECVBUF-1); |
/* Special hack - let the user switch to old mode if in the Ns_Add | | /* Special hack - let the user switch to old mode if in the Ns_Add |
* phase. Don't demand they add in the special length bytes | | * phase. Don't demand they add in the special length bytes |
*/ | | */ |
| | |
/* Still dont have a full packet */ | | /* Still dont have a full packet */ |
if (i==0) return; | | if (i==0) return; |
| | |
| | ns->inbuf.buf[ns->inbuf.len]='\0'; /* Terminate buffer - useful for string data */ |
| | |
/* First, break out beginning word. There are at least | | /* First, break out beginning word. There are at least |
* a few commands that do not have any paremeters. If | | * a few commands that do not have any paremeters. If |
* we get such a command, don't worry about trying | | * we get such a command, don't worry about trying |
| | |
} | | } |
else len=0; | | else len=0; |
| | |
ns->inbuf.buf[ns->inbuf.len]='\0'; /* Terminate buffer - useful for string data */ | | |
for (i=0; client_commands[i].cmdname !=NULL; i++) { | | for (i=0; client_commands[i].cmdname !=NULL; i++) { |
if (strcmp((char*)ns->inbuf.buf+2,client_commands[i].cmdname)==0) { | | if (strcmp((char*)ns->inbuf.buf+2,client_commands[i].cmdname)==0) { |
client_commands[i].cmdproc((char*)data,len,ns); | | client_commands[i].cmdproc((char*)data,len,ns); |