-const char jcc_rcs[] = "$Id: jcc.c,v 1.80 2002/03/11 22:07:05 david__schmidt Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.81 2002/03/12 01:42:50 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.81 2002/03/12 01:42:50 oes
+ * Introduced modular filters
+ *
* Revision 1.80 2002/03/11 22:07:05 david__schmidt
* OS/2 port maintenance:
* - Fixed EMX build - it had decayed a little
* could get blocked here if a client connected, then didn't say anything!
*/
- while (FOREVER)
+ for (;;)
{
len = read_socket(csp->cfd, buf, sizeof(buf));
/* grab the rest of the client's headers */
- while (FOREVER)
+ for (;;)
{
- if ( ( p = get_header(csp) ) && ( *p == '\0' ) )
+ if ( ( ( p = get_header(csp) ) != NULL) && ( *p == '\0' ) )
{
len = read_socket(csp->cfd, buf, sizeof(buf));
if (len <= 0)
server_body = 0;
- while (FOREVER)
+ for (;;)
{
#ifdef __OS2__
/*
FD_SET(csp->cfd, &rfds);
FD_SET(csp->sfd, &rfds);
- n = select(maxfd+1, &rfds, NULL, NULL, NULL);
+ n = select((int)maxfd+1, &rfds, NULL, NULL, NULL);
if (n < 0)
{
break; /* "game over, man" */
}
- if (write_socket(csp->sfd, buf, len))
+ if (write_socket(csp->sfd, buf, (size_t)len))
{
log_error(LOG_LEVEL_ERROR, "write to: %s failed: %E", http->host);
return;
*/
if (((size_t)(csp->iob->eod - csp->iob->buf)) + (size_t)BUFFER_SIZE > csp->config->buffer_limit)
{
+ size_t hdrlen;
+
log_error(LOG_LEVEL_ERROR, "Buffer size limit reached! Flushing and stepping back.");
hdr = sed(server_patterns, add_server_headers, csp);
log_error(LOG_LEVEL_FATAL, "Out of memory parsing server header");
}
- len = strlen(hdr);
- byte_count += len;
+ hdrlen = strlen(hdr);
+ byte_count += hdrlen;
- if (write_socket(csp->cfd, hdr, len)
- || (len = flush_socket(csp->cfd, csp) < 0))
+ if (write_socket(csp->cfd, hdr, hdrlen)
+ || ((len = flush_socket(csp->cfd, csp)) < 0))
{
log_error(LOG_LEVEL_CONNECT, "write header to client failed: %E");
}
else
{
- if (write_socket(csp->cfd, buf, len))
+ if (write_socket(csp->cfd, buf, (size_t)len))
{
log_error(LOG_LEVEL_ERROR, "write to client failed: %E");
return;
/* get header lines from the iob */
- while ((p = get_header(csp)))
+ while ((p = get_header(csp)) != NULL)
{
if (*p == '\0')
{
* may be in the buffer)
*/
- len = strlen(hdr);
-
- if (write_socket(csp->cfd, hdr, len)
- || (len = flush_socket(csp->cfd, csp) < 0))
+ if (write_socket(csp->cfd, hdr, strlen(hdr))
+ || ((len = flush_socket(csp->cfd, csp)) < 0))
{
log_error(LOG_LEVEL_CONNECT, "write header to client failed: %E");
bfd = bind_port_helper(config);
- while (FOREVER)
+ for (;;)
{
#if !defined(FEATURE_PTHREAD) && !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__)
while (waitpid(-1, NULL, WNOHANG) > 0)
#if defined(_WIN32) && !defined(_CYGWIN) && !defined(SELECTED_ONE_OPTION)
#define SELECTED_ONE_OPTION
child_id = _beginthread(
- (void*)serve,
+ (void (*)(void *))serve,
64 * 1024,
csp);
#endif