diff options
Diffstat (limited to 'src/examples/timeout.c')
-rw-r--r-- | src/examples/timeout.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/examples/timeout.c b/src/examples/timeout.c index 91de1599..cfb66950 100644 --- a/src/examples/timeout.c +++ b/src/examples/timeout.c | |||
@@ -30,27 +30,27 @@ | |||
30 | #define PORT 8080 | 30 | #define PORT 8080 |
31 | 31 | ||
32 | static int | 32 | static int |
33 | answer_to_connection(void *cls, | 33 | answer_to_connection (void *cls, |
34 | struct MHD_Connection *connection, | 34 | struct MHD_Connection *connection, |
35 | const char *url, | 35 | const char *url, |
36 | const char *method, | 36 | const char *method, |
37 | const char *version, | 37 | const char *version, |
38 | const char *upload_data, | 38 | const char *upload_data, |
39 | size_t *upload_data_size, | 39 | size_t *upload_data_size, |
40 | void **con_cls) | 40 | void **con_cls) |
41 | { | 41 | { |
42 | const char *page = "<html><body>Hello timeout!</body></html>"; | 42 | const char *page = "<html><body>Hello timeout!</body></html>"; |
43 | struct MHD_Response *response; | 43 | struct MHD_Response *response; |
44 | int ret; | 44 | int ret; |
45 | (void)cls; /* Unused. Silent compiler warning. */ | 45 | (void) cls; /* Unused. Silent compiler warning. */ |
46 | (void)url; /* Unused. Silent compiler warning. */ | 46 | (void) url; /* Unused. Silent compiler warning. */ |
47 | (void)version; /* Unused. Silent compiler warning. */ | 47 | (void) version; /* Unused. Silent compiler warning. */ |
48 | (void)method; /* Unused. Silent compiler warning. */ | 48 | (void) method; /* Unused. Silent compiler warning. */ |
49 | (void)upload_data; /* Unused. Silent compiler warning. */ | 49 | (void) upload_data; /* Unused. Silent compiler warning. */ |
50 | (void)upload_data_size; /* Unused. Silent compiler warning. */ | 50 | (void) upload_data_size; /* Unused. Silent compiler warning. */ |
51 | (void)con_cls; /* Unused. Silent compiler warning. */ | 51 | (void) con_cls; /* Unused. Silent compiler warning. */ |
52 | 52 | ||
53 | response = MHD_create_response_from_buffer (strlen(page), | 53 | response = MHD_create_response_from_buffer (strlen (page), |
54 | (void *) page, | 54 | (void *) page, |
55 | MHD_RESPMEM_PERSISTENT); | 55 | MHD_RESPMEM_PERSISTENT); |
56 | MHD_add_response_header (response, | 56 | MHD_add_response_header (response, |
@@ -59,7 +59,7 @@ answer_to_connection(void *cls, | |||
59 | ret = MHD_queue_response (connection, | 59 | ret = MHD_queue_response (connection, |
60 | MHD_HTTP_OK, | 60 | MHD_HTTP_OK, |
61 | response); | 61 | response); |
62 | MHD_destroy_response(response); | 62 | MHD_destroy_response (response); |
63 | return ret; | 63 | return ret; |
64 | } | 64 | } |
65 | 65 | ||
@@ -69,7 +69,8 @@ main (void) | |||
69 | { | 69 | { |
70 | struct MHD_Daemon *daemon; | 70 | struct MHD_Daemon *daemon; |
71 | 71 | ||
72 | daemon = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD, | 72 | daemon = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION |
73 | | MHD_USE_INTERNAL_POLLING_THREAD, | ||
73 | PORT, | 74 | PORT, |
74 | NULL, NULL, | 75 | NULL, NULL, |
75 | &answer_to_connection, NULL, | 76 | &answer_to_connection, NULL, |
@@ -78,7 +79,7 @@ main (void) | |||
78 | MHD_OPTION_END); | 79 | MHD_OPTION_END); |
79 | if (NULL == daemon) | 80 | if (NULL == daemon) |
80 | return 1; | 81 | return 1; |
81 | (void) getchar(); | 82 | (void) getchar (); |
82 | MHD_stop_daemon (daemon); | 83 | MHD_stop_daemon (daemon); |
83 | return 0; | 84 | return 0; |
84 | } | 85 | } |