mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
fix
This commit is contained in:
@@ -531,6 +531,7 @@ MHD_call_connection_handler(struct MHD_Connection * connection) {
|
||||
connection,
|
||||
connection->url,
|
||||
connection->method,
|
||||
connection->version,
|
||||
connection->read_buffer,
|
||||
&processed)) {
|
||||
/* serios internal error, close connection */
|
||||
|
||||
+2
-3
@@ -461,7 +461,8 @@ MHD_start_daemon(unsigned int options,
|
||||
MHD_AcceptPolicyCallback apc,
|
||||
void * apc_cls,
|
||||
MHD_AccessHandlerCallback dh,
|
||||
void * dh_cls) {
|
||||
void * dh_cls,
|
||||
...) {
|
||||
struct MHD_Daemon * retVal;
|
||||
int socket_fd;
|
||||
struct sockaddr_in servaddr;
|
||||
@@ -470,8 +471,6 @@ MHD_start_daemon(unsigned int options,
|
||||
return NULL;
|
||||
if ((options & MHD_USE_IPv6) != 0)
|
||||
return NULL;
|
||||
if ((options & MHD_USE_IPv4) == 0)
|
||||
return NULL;
|
||||
if ( (port == 0) ||
|
||||
(dh == NULL) )
|
||||
return NULL;
|
||||
|
||||
@@ -156,8 +156,8 @@ struct MHD_Response {
|
||||
|
||||
|
||||
|
||||
struct MHD_Session {
|
||||
struct MHD_Session * next;
|
||||
struct MHD_Connection {
|
||||
struct MHD_Connection * next;
|
||||
|
||||
struct MHD_Daemon * daemon;
|
||||
|
||||
@@ -196,7 +196,7 @@ struct MHD_Session {
|
||||
struct sockaddr_in * addr;
|
||||
|
||||
/**
|
||||
* Thread for this session (if we are using
|
||||
* Thread for this connection (if we are using
|
||||
* one thread per connection).
|
||||
*/
|
||||
pthread_t pid;
|
||||
@@ -279,7 +279,7 @@ struct MHD_Daemon {
|
||||
|
||||
struct MHD_Access_Handler default_handler;
|
||||
|
||||
struct MHD_Session * connections;
|
||||
struct MHD_Connection * connections;
|
||||
|
||||
MHD_AcceptPolicyCallback apc;
|
||||
|
||||
|
||||
@@ -42,10 +42,11 @@ static int apc_all(void * cls,
|
||||
}
|
||||
|
||||
static int ahc_echo(void * cls,
|
||||
struct MHD_Session * session,
|
||||
struct MHD_Connection * connection,
|
||||
const char * url,
|
||||
const char * method,
|
||||
const char * upload_data,
|
||||
const char * version,
|
||||
unsigned int * upload_data_size) {
|
||||
const char * me = cls;
|
||||
struct MHD_Response * response;
|
||||
@@ -57,7 +58,7 @@ static int ahc_echo(void * cls,
|
||||
(void*) me,
|
||||
MHD_NO,
|
||||
MHD_NO);
|
||||
ret = MHD_queue_response(session,
|
||||
ret = MHD_queue_response(connection,
|
||||
MHD_HTTP_OK,
|
||||
response);
|
||||
MHD_destroy_response(response);
|
||||
@@ -73,12 +74,13 @@ int main(int argc,
|
||||
argv[0]);
|
||||
return 1;
|
||||
}
|
||||
d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_IPv4 | MHD_USE_DEBUG,
|
||||
d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG,
|
||||
atoi(argv[1]),
|
||||
&apc_all,
|
||||
NULL,
|
||||
&ahc_echo,
|
||||
PAGE);
|
||||
PAGE,
|
||||
MHD_OPTION_END);
|
||||
if (d == NULL)
|
||||
return 1;
|
||||
sleep(atoi(argv[2]));
|
||||
|
||||
Reference in New Issue
Block a user