diff options
Diffstat (limited to 'src/daemon/minimal_example.c')
-rw-r--r-- | src/daemon/minimal_example.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/daemon/minimal_example.c b/src/daemon/minimal_example.c index b25ad106..5e67b981 100644 --- a/src/daemon/minimal_example.c +++ b/src/daemon/minimal_example.c | |||
@@ -42,10 +42,11 @@ static int apc_all(void * cls, | |||
42 | } | 42 | } |
43 | 43 | ||
44 | static int ahc_echo(void * cls, | 44 | static int ahc_echo(void * cls, |
45 | struct MHD_Session * session, | 45 | struct MHD_Connection * connection, |
46 | const char * url, | 46 | const char * url, |
47 | const char * method, | 47 | const char * method, |
48 | const char * upload_data, | 48 | const char * upload_data, |
49 | const char * version, | ||
49 | unsigned int * upload_data_size) { | 50 | unsigned int * upload_data_size) { |
50 | const char * me = cls; | 51 | const char * me = cls; |
51 | struct MHD_Response * response; | 52 | struct MHD_Response * response; |
@@ -57,7 +58,7 @@ static int ahc_echo(void * cls, | |||
57 | (void*) me, | 58 | (void*) me, |
58 | MHD_NO, | 59 | MHD_NO, |
59 | MHD_NO); | 60 | MHD_NO); |
60 | ret = MHD_queue_response(session, | 61 | ret = MHD_queue_response(connection, |
61 | MHD_HTTP_OK, | 62 | MHD_HTTP_OK, |
62 | response); | 63 | response); |
63 | MHD_destroy_response(response); | 64 | MHD_destroy_response(response); |
@@ -73,12 +74,13 @@ int main(int argc, | |||
73 | argv[0]); | 74 | argv[0]); |
74 | return 1; | 75 | return 1; |
75 | } | 76 | } |
76 | d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_IPv4 | MHD_USE_DEBUG, | 77 | d = MHD_start_daemon(MHD_USE_THREAD_PER_CONNECTION | MHD_USE_DEBUG, |
77 | atoi(argv[1]), | 78 | atoi(argv[1]), |
78 | &apc_all, | 79 | &apc_all, |
79 | NULL, | 80 | NULL, |
80 | &ahc_echo, | 81 | &ahc_echo, |
81 | PAGE); | 82 | PAGE, |
83 | MHD_OPTION_END); | ||
82 | if (d == NULL) | 84 | if (d == NULL) |
83 | return 1; | 85 | return 1; |
84 | sleep(atoi(argv[2])); | 86 | sleep(atoi(argv[2])); |