73 |
static void destroy_entry(void *); |
static void destroy_entry(void *); |
74 |
static void internal_error(int, int, char *); |
static void internal_error(int, int, char *); |
75 |
static HttpParameter parse_parameters(char *); |
static HttpParameter parse_parameters(char *); |
|
static int do_timeout(int); |
|
76 |
static void request_timeout(int); |
static void request_timeout(int); |
77 |
|
|
78 |
|
|
121 |
|
|
122 |
RequestWrapper W= wrapper; |
RequestWrapper W= wrapper; |
123 |
|
|
124 |
if (do_timeout(W->socket)) |
set_alarm_handler(request_timeout); |
125 |
goto shutdown; |
alarm(REQUEST_TIMEOUT); |
126 |
|
|
127 |
|
if(sigsetjmp(timeout, TRUE) ) { |
128 |
|
|
129 |
|
internal_error(W->socket, SC_REQUEST_TIMEOUT, |
130 |
|
"Time out when handling the Request"); |
131 |
|
goto shutdown; |
132 |
|
|
133 |
|
} |
134 |
|
|
135 |
do_service(W); |
do_service(W); |
136 |
|
|
972 |
|
|
973 |
|
|
974 |
/** |
/** |
|
* Activate a timeout alarm clock, set a signal handler to handle the |
|
|
* alarm and a jmp_buffer for handling a timeout. |
|
|
*/ |
|
|
static int do_timeout(int client) { |
|
|
|
|
|
set_alarm_handler(request_timeout); |
|
|
|
|
|
alarm(REQUEST_TIMEOUT); |
|
|
|
|
|
if ( sigsetjmp(timeout, TRUE) ) { |
|
|
|
|
|
internal_error(client, SC_REQUEST_TIMEOUT, |
|
|
"Time out when handling the Request"); |
|
|
|
|
|
return TRUE; |
|
|
|
|
|
} |
|
|
|
|
|
return FALSE; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
975 |
* Do Basic Authentication if this auth. style is allowed. |
* Do Basic Authentication if this auth. style is allowed. |
976 |
*/ |
*/ |
977 |
static int is_authenticated(HttpRequest req, HttpResponse res) { |
static int is_authenticated(HttpRequest req, HttpResponse res) { |