aboutsummaryrefslogtreecommitdiff
path: root/src/examples/minimal_example_comet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/minimal_example_comet.c')
-rw-r--r--src/examples/minimal_example_comet.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/examples/minimal_example_comet.c b/src/examples/minimal_example_comet.c
index c4a3395d..53f8f666 100644
--- a/src/examples/minimal_example_comet.c
+++ b/src/examples/minimal_example_comet.c
@@ -28,8 +28,8 @@
28static ssize_t 28static ssize_t
29data_generator (void *cls, uint64_t pos, char *buf, size_t max) 29data_generator (void *cls, uint64_t pos, char *buf, size_t max)
30{ 30{
31 (void)cls; /* Unused. Silent compiler warning. */ 31 (void) cls; /* Unused. Silent compiler warning. */
32 (void)pos; /* Unused. Silent compiler warning. */ 32 (void) pos; /* Unused. Silent compiler warning. */
33 if (max < 80) 33 if (max < 80)
34 return 0; 34 return 0;
35 memset (buf, 'A', max - 1); 35 memset (buf, 'A', max - 1);
@@ -48,20 +48,20 @@ ahc_echo (void *cls,
48 static int aptr; 48 static int aptr;
49 struct MHD_Response *response; 49 struct MHD_Response *response;
50 int ret; 50 int ret;
51 (void)cls; /* Unused. Silent compiler warning. */ 51 (void) cls; /* Unused. Silent compiler warning. */
52 (void)url; /* Unused. Silent compiler warning. */ 52 (void) url; /* Unused. Silent compiler warning. */
53 (void)version; /* Unused. Silent compiler warning. */ 53 (void) version; /* Unused. Silent compiler warning. */
54 (void)upload_data; /* Unused. Silent compiler warning. */ 54 (void) upload_data; /* Unused. Silent compiler warning. */
55 (void)upload_data_size; /* Unused. Silent compiler warning. */ 55 (void) upload_data_size; /* Unused. Silent compiler warning. */
56 56
57 if (0 != strcmp (method, "GET")) 57 if (0 != strcmp (method, "GET"))
58 return MHD_NO; /* unexpected method */ 58 return MHD_NO; /* unexpected method */
59 if (&aptr != *ptr) 59 if (&aptr != *ptr)
60 { 60 {
61 /* do never respond on first call */ 61 /* do never respond on first call */
62 *ptr = &aptr; 62 *ptr = &aptr;
63 return MHD_YES; 63 return MHD_YES;
64 } 64 }
65 *ptr = NULL; /* reset when done */ 65 *ptr = NULL; /* reset when done */
66 response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, 66 response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN,
67 80, 67 80,
@@ -77,11 +77,12 @@ main (int argc, char *const *argv)
77 struct MHD_Daemon *d; 77 struct MHD_Daemon *d;
78 78
79 if (argc != 2) 79 if (argc != 2)
80 { 80 {
81 printf ("%s PORT\n", argv[0]); 81 printf ("%s PORT\n", argv[0]);
82 return 1; 82 return 1;
83 } 83 }
84 d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_THREAD_PER_CONNECTION | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, 84 d = MHD_start_daemon (MHD_USE_AUTO | MHD_USE_THREAD_PER_CONNECTION
85 | MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
85 atoi (argv[1]), 86 atoi (argv[1]),
86 NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END); 87 NULL, NULL, &ahc_echo, NULL, MHD_OPTION_END);
87 if (d == NULL) 88 if (d == NULL)