xpans.c | xpans.c | |||
---|---|---|---|---|
skipping to change at line 1030 | skipping to change at line 1030 | |||
XPALongTimeout()); | XPALongTimeout()); | |||
} | } | |||
} | } | |||
else{ | else{ | |||
strcpy(tbuf, "XPA$ERROR 'del' requires 1 arg: ip:port\n"); | strcpy(tbuf, "XPA$ERROR 'del' requires 1 arg: ip:port\n"); | |||
XPAPuts(NULL, req->sock, tbuf, XPALongTimeout()); | XPAPuts(NULL, req->sock, tbuf, XPALongTimeout()); | |||
} | } | |||
} | } | |||
else{ | else{ | |||
/* connection is closed -- free all entries for req, and delete req */ | /* connection is closed -- free all entries for req, and delete req */ | |||
FPRINTF((stderr, "%sxpans request really died: %d\n", _sp, req->sock)); | ||||
DelEntry(req, NULL); | DelEntry(req, NULL); | |||
FreeReq(req); | FreeReq(req); | |||
Log(); | Log(); | |||
} | } | |||
} | } | |||
/* | /* | |||
*------------------------------------------------------------------------- --- | *------------------------------------------------------------------------- --- | |||
* | * | |||
* Routine: DelProxyReq | * Routine: DelProxyReq | |||
skipping to change at line 1810 | skipping to change at line 1811 | |||
break; | break; | |||
#endif | #endif | |||
default: | default: | |||
break; | break; | |||
} | } | |||
} | } | |||
/* process an existing request line */ | /* process an existing request line */ | |||
for(got=0, req=reqhead; req!=NULL; ){ | for(got=0, req=reqhead; req!=NULL; ){ | |||
treq = req->next; | treq = req->next; | |||
if( FD_ISSET(req->sock, &readfds) ){ | if( FD_ISSET(req->sock, &readfds) ){ | |||
FPRINTF((stderr, "%sxpans existing request: %d\n", _sp, req->sock) ); | ||||
if( XPAGets(NULL, req->sock, lbuf, SZ_LINE, XPAShortTimeout()) >0 ){ | if( XPAGets(NULL, req->sock, lbuf, SZ_LINE, XPAShortTimeout()) >0 ){ | |||
if( lbuf[strlen(lbuf)-1] == '\n' ) | if( lbuf[strlen(lbuf)-1] == '\n' ) | |||
lbuf[strlen(lbuf)-1] = '\0'; | lbuf[strlen(lbuf)-1] = '\0'; | |||
FPRINTF((stderr, "%sxpans request: %s\n", _sp, lbuf)); | ||||
SecureLog("cmd %d: %s", req->sock, lbuf); | SecureLog("cmd %d: %s", req->sock, lbuf); | |||
/* process another request from this process */ | /* process another request from this process */ | |||
wp = 0; | wp = 0; | |||
/* get first token: command */ | /* get first token: command */ | |||
if( !word(lbuf, cmd, &wp) ){ | if( !word(lbuf, cmd, &wp) ){ | |||
strcpy(tbuf, "XPA$ERROR no xpans command specified\n"); | strcpy(tbuf, "XPA$ERROR no xpans command specified\n"); | |||
XPAPuts(NULL, req->sock, tbuf, XPALongTimeout()); | XPAPuts(NULL, req->sock, tbuf, XPALongTimeout()); | |||
} | } | |||
else{ | else{ | |||
/* skip white space */ | /* skip white space */ | |||
skipping to change at line 1863 | skipping to change at line 1866 | |||
else{ | else{ | |||
SecureLog("ignoring unknown command"); | SecureLog("ignoring unknown command"); | |||
snprintf(tbuf, SZ_LINE, | snprintf(tbuf, SZ_LINE, | |||
"XPA$ERROR unknown xpans request: %s\n", lbuf); | "XPA$ERROR unknown xpans request: %s\n", lbuf); | |||
XPAPuts(NULL, req->sock, tbuf, XPALongTimeout()); | XPAPuts(NULL, req->sock, tbuf, XPALongTimeout()); | |||
} | } | |||
} | } | |||
} | } | |||
else{ | else{ | |||
/* process dies: delete all entries associated with this sock */ | /* process dies: delete all entries associated with this sock */ | |||
FPRINTF((stderr, "%sxpans request died: %d\n", _sp, req->sock)); | ||||
DelReq(req, NULL, 1); | DelReq(req, NULL, 1); | |||
} | } | |||
} | } | |||
req = treq; | req = treq; | |||
} | } | |||
/* process xpa requests */ | /* process xpa requests */ | |||
if( doproxy < 2 ) XPAProcessSelect(&readfds, 0); | if( doproxy < 2 ) XPAProcessSelect(&readfds, 0); | |||
#if HAVE_LIBPTHREAD | #if HAVE_LIBPTHREAD | |||
/* unlock the mutex */ | /* unlock the mutex */ | |||
End of changes. 4 change blocks. | ||||
0 lines changed or deleted | 4 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |