-const char jcc_rcs[] = "$Id: jcc.c,v 1.463 2017/06/26 12:12:55 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.468 2017/08/12 09:33:25 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
# ifndef FD_ZERO
# include <select.h>
# endif
+#warning poll() appears to be unavailable. Your platform will become unsupported in the future.
#endif /* HAVE_POLL */
#endif
* Returns : Nothing.
*
*********************************************************************/
-static void handle_established_connection(struct client_state *csp,
- const struct forward_spec *fwd)
+static void handle_established_connection(struct client_state *csp)
{
char *receive_buffer;
char *hdr;
if (n == 0)
{
- log_error(LOG_LEVEL_ERROR,
- "Didn't receive data in time: %s", http->url);
+ log_error(LOG_LEVEL_CONNECT, "Socket timeout %d reached: %s",
+ csp->config->socket_timeout, http->url);
if ((byte_count == 0) && (http->ssl == 0))
{
send_crunch_response(csp, error_response(csp, "connection-timeout"));
{
log_error(LOG_LEVEL_ERROR, "read from: %s failed: %E", http->host);
- if (http->ssl && (fwd->forward_host == NULL))
+ if (http->ssl && (csp->fwd == NULL))
{
/*
* Just hang up. We already confirmed the client's CONNECT
/* XXX: should the time start earlier for optimistically sent data? */
csp->server_connection.request_sent = time(NULL);
- handle_established_connection(csp, fwd);
+ handle_established_connection(csp);
}
fuzz_input_file);
}
}
+ csp->fwd = &fwd;
csp->content_type |= CT_GIF;
csp->action->flags |= ACTION_DEANIMATE;
csp->action->string[ACTION_STRING_DEANIMATE] = "last";
cgi_init_error_messages();
- handle_established_connection(csp, &fwd);
+ handle_established_connection(csp);
return 0;
}
drain_and_close_socket(csp->cfd);
}
+ free_csp_resources(csp);
+
csp->flags &= ~CSP_FLAG_ACTIVE;
}
jb_socket bfds[MAX_LISTENING_SOCKETS];
struct configuration_spec *config;
unsigned int active_threads = 0;
+#if defined(FEATURE_PTHREAD)
+ pthread_attr_t attrs;
+
+ pthread_attr_init(&attrs);
+ pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED);
+#endif
config = load_config();
#define SELECTED_ONE_OPTION
{
pthread_t the_thread;
- pthread_attr_t attrs;
- pthread_attr_init(&attrs);
- pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED);
errno = pthread_create(&the_thread, &attrs,
(void * (*)(void *))serve, csp);
child_id = errno ? -1 : 0;
- pthread_attr_destroy(&attrs);
}
#endif
}
}
+#if defined(FEATURE_PTHREAD)
+ pthread_attr_destroy(&attrs);
+#endif
+
/* NOTREACHED unless FEATURE_GRACEFUL_TERMINATION is defined */
/* Clean up. Aim: free all memory (no leaks) */