diff options
Diffstat (limited to 'src/examples')
28 files changed, 128 insertions, 128 deletions
diff --git a/src/examples/authorization_example.c b/src/examples/authorization_example.c index f9500325..e7a099ed 100644 --- a/src/examples/authorization_example.c +++ b/src/examples/authorization_example.c | |||
@@ -45,7 +45,7 @@ ahc_echo (void *cls, | |||
45 | const char *url, | 45 | const char *url, |
46 | const char *method, | 46 | const char *method, |
47 | const char *version, | 47 | const char *version, |
48 | const char *upload_data, size_t *upload_data_size, void **ptr) | 48 | const char *upload_data, size_t *upload_data_size, void **req_cls) |
49 | { | 49 | { |
50 | static int aptr; | 50 | static int aptr; |
51 | const char *me = cls; | 51 | const char *me = cls; |
@@ -61,13 +61,13 @@ ahc_echo (void *cls, | |||
61 | 61 | ||
62 | if (0 != strcmp (method, "GET")) | 62 | if (0 != strcmp (method, "GET")) |
63 | return MHD_NO; /* unexpected method */ | 63 | return MHD_NO; /* unexpected method */ |
64 | if (&aptr != *ptr) | 64 | if (&aptr != *req_cls) |
65 | { | 65 | { |
66 | /* do never respond on first call */ | 66 | /* do never respond on first call */ |
67 | *ptr = &aptr; | 67 | *req_cls = &aptr; |
68 | return MHD_YES; | 68 | return MHD_YES; |
69 | } | 69 | } |
70 | *ptr = NULL; /* reset when done */ | 70 | *req_cls = NULL; /* reset when done */ |
71 | 71 | ||
72 | /* require: "Aladdin" with password "open sesame" */ | 72 | /* require: "Aladdin" with password "open sesame" */ |
73 | pass = NULL; | 73 | pass = NULL; |
diff --git a/src/examples/benchmark.c b/src/examples/benchmark.c index a579d42b..185e3824 100644 --- a/src/examples/benchmark.c +++ b/src/examples/benchmark.c | |||
@@ -62,7 +62,7 @@ static struct MHD_Response *response; | |||
62 | * | 62 | * |
63 | * @param cls client-defined closure | 63 | * @param cls client-defined closure |
64 | * @param connection connection handle | 64 | * @param connection connection handle |
65 | * @param con_cls value as set by the last call to | 65 | * @param req_cls value as set by the last call to |
66 | * the MHD_AccessHandlerCallback | 66 | * the MHD_AccessHandlerCallback |
67 | * @param toe reason for request termination | 67 | * @param toe reason for request termination |
68 | * @see MHD_OPTION_NOTIFY_COMPLETED | 68 | * @see MHD_OPTION_NOTIFY_COMPLETED |
@@ -70,10 +70,10 @@ static struct MHD_Response *response; | |||
70 | static void | 70 | static void |
71 | completed_callback (void *cls, | 71 | completed_callback (void *cls, |
72 | struct MHD_Connection *connection, | 72 | struct MHD_Connection *connection, |
73 | void **con_cls, | 73 | void **req_cls, |
74 | enum MHD_RequestTerminationCode toe) | 74 | enum MHD_RequestTerminationCode toe) |
75 | { | 75 | { |
76 | struct timeval *tv = *con_cls; | 76 | struct timeval *tv = *req_cls; |
77 | struct timeval tve; | 77 | struct timeval tve; |
78 | uint64_t delta; | 78 | uint64_t delta; |
79 | (void) cls; /* Unused. Silent compiler warning. */ | 79 | (void) cls; /* Unused. Silent compiler warning. */ |
@@ -119,14 +119,14 @@ ahc_echo (void *cls, | |||
119 | const char *url, | 119 | const char *url, |
120 | const char *method, | 120 | const char *method, |
121 | const char *version, | 121 | const char *version, |
122 | const char *upload_data, size_t *upload_data_size, void **ptr) | 122 | const char *upload_data, size_t *upload_data_size, void **req_cls) |
123 | { | 123 | { |
124 | (void) cls; /* Unused. Silent compiler warning. */ | 124 | (void) cls; /* Unused. Silent compiler warning. */ |
125 | (void) url; /* Unused. Silent compiler warning. */ | 125 | (void) url; /* Unused. Silent compiler warning. */ |
126 | (void) version; /* Unused. Silent compiler warning. */ | 126 | (void) version; /* Unused. Silent compiler warning. */ |
127 | (void) upload_data; /* Unused. Silent compiler warning. */ | 127 | (void) upload_data; /* Unused. Silent compiler warning. */ |
128 | (void) upload_data_size; /* Unused. Silent compiler warning. */ | 128 | (void) upload_data_size; /* Unused. Silent compiler warning. */ |
129 | (void) ptr; /* Unused. Silent compiler warning. */ | 129 | (void) req_cls; /* Unused. Silent compiler warning. */ |
130 | 130 | ||
131 | if (0 != strcmp (method, "GET")) | 131 | if (0 != strcmp (method, "GET")) |
132 | return MHD_NO; /* unexpected method */ | 132 | return MHD_NO; /* unexpected method */ |
diff --git a/src/examples/benchmark_https.c b/src/examples/benchmark_https.c index ddc3be19..36a46aa8 100644 --- a/src/examples/benchmark_https.c +++ b/src/examples/benchmark_https.c | |||
@@ -62,7 +62,7 @@ static struct MHD_Response *response; | |||
62 | * | 62 | * |
63 | * @param cls client-defined closure | 63 | * @param cls client-defined closure |
64 | * @param connection connection handle | 64 | * @param connection connection handle |
65 | * @param con_cls value as set by the last call to | 65 | * @param req_cls value as set by the last call to |
66 | * the MHD_AccessHandlerCallback | 66 | * the MHD_AccessHandlerCallback |
67 | * @param toe reason for request termination | 67 | * @param toe reason for request termination |
68 | * @see MHD_OPTION_NOTIFY_COMPLETED | 68 | * @see MHD_OPTION_NOTIFY_COMPLETED |
@@ -70,10 +70,10 @@ static struct MHD_Response *response; | |||
70 | static void | 70 | static void |
71 | completed_callback (void *cls, | 71 | completed_callback (void *cls, |
72 | struct MHD_Connection *connection, | 72 | struct MHD_Connection *connection, |
73 | void **con_cls, | 73 | void **req_cls, |
74 | enum MHD_RequestTerminationCode toe) | 74 | enum MHD_RequestTerminationCode toe) |
75 | { | 75 | { |
76 | struct timeval *tv = *con_cls; | 76 | struct timeval *tv = *req_cls; |
77 | struct timeval tve; | 77 | struct timeval tve; |
78 | uint64_t delta; | 78 | uint64_t delta; |
79 | (void) cls; /* Unused. Silent compiler warning. */ | 79 | (void) cls; /* Unused. Silent compiler warning. */ |
@@ -119,14 +119,14 @@ ahc_echo (void *cls, | |||
119 | const char *url, | 119 | const char *url, |
120 | const char *method, | 120 | const char *method, |
121 | const char *version, | 121 | const char *version, |
122 | const char *upload_data, size_t *upload_data_size, void **ptr) | 122 | const char *upload_data, size_t *upload_data_size, void **req_cls) |
123 | { | 123 | { |
124 | (void) cls; /* Unused. Silent compiler warning. */ | 124 | (void) cls; /* Unused. Silent compiler warning. */ |
125 | (void) url; /* Unused. Silent compiler warning. */ | 125 | (void) url; /* Unused. Silent compiler warning. */ |
126 | (void) version; /* Unused. Silent compiler warning. */ | 126 | (void) version; /* Unused. Silent compiler warning. */ |
127 | (void) upload_data; /* Unused. Silent compiler warning. */ | 127 | (void) upload_data; /* Unused. Silent compiler warning. */ |
128 | (void) upload_data_size; /* Unused. Silent compiler warning. */ | 128 | (void) upload_data_size; /* Unused. Silent compiler warning. */ |
129 | (void) ptr; /* Unused. Silent compiler warning. */ | 129 | (void) req_cls; /* Unused. Silent compiler warning. */ |
130 | 130 | ||
131 | if (0 != strcmp (method, "GET")) | 131 | if (0 != strcmp (method, "GET")) |
132 | return MHD_NO; /* unexpected method */ | 132 | return MHD_NO; /* unexpected method */ |
diff --git a/src/examples/chunked_example.c b/src/examples/chunked_example.c index 68b7ea1e..5a4c0ced 100644 --- a/src/examples/chunked_example.c +++ b/src/examples/chunked_example.c | |||
@@ -97,7 +97,7 @@ ahc_echo (void *cls, | |||
97 | const char *version, | 97 | const char *version, |
98 | const char *upload_data, | 98 | const char *upload_data, |
99 | size_t *upload_data_size, | 99 | size_t *upload_data_size, |
100 | void **ptr) | 100 | void **req_cls) |
101 | { | 101 | { |
102 | static int aptr; | 102 | static int aptr; |
103 | struct ResponseContentCallbackParam *callback_param; | 103 | struct ResponseContentCallbackParam *callback_param; |
@@ -111,10 +111,10 @@ ahc_echo (void *cls, | |||
111 | 111 | ||
112 | if (0 != strcmp (method, "GET")) | 112 | if (0 != strcmp (method, "GET")) |
113 | return MHD_NO; /* unexpected method */ | 113 | return MHD_NO; /* unexpected method */ |
114 | if (&aptr != *ptr) | 114 | if (&aptr != *req_cls) |
115 | { | 115 | { |
116 | /* do never respond on first call */ | 116 | /* do never respond on first call */ |
117 | *ptr = &aptr; | 117 | *req_cls = &aptr; |
118 | return MHD_YES; | 118 | return MHD_YES; |
119 | } | 119 | } |
120 | 120 | ||
@@ -126,7 +126,7 @@ ahc_echo (void *cls, | |||
126 | callback_param->response_size = (sizeof(simple_response_text) | 126 | callback_param->response_size = (sizeof(simple_response_text) |
127 | / sizeof(char)) - 1; | 127 | / sizeof(char)) - 1; |
128 | 128 | ||
129 | *ptr = NULL; /* reset when done */ | 129 | *req_cls = NULL; /* reset when done */ |
130 | response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, | 130 | response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, |
131 | 1024, | 131 | 1024, |
132 | &callback, | 132 | &callback, |
diff --git a/src/examples/connection_close.c b/src/examples/connection_close.c index 5629a687..e5f787a3 100644 --- a/src/examples/connection_close.c +++ b/src/examples/connection_close.c | |||
@@ -41,7 +41,7 @@ ahc_echo (void *cls, | |||
41 | const char *url, | 41 | const char *url, |
42 | const char *method, | 42 | const char *method, |
43 | const char *version, | 43 | const char *version, |
44 | const char *upload_data, size_t *upload_data_size, void **ptr) | 44 | const char *upload_data, size_t *upload_data_size, void **req_cls) |
45 | { | 45 | { |
46 | static int aptr; | 46 | static int aptr; |
47 | const char *me = cls; | 47 | const char *me = cls; |
@@ -54,13 +54,13 @@ ahc_echo (void *cls, | |||
54 | 54 | ||
55 | if (0 != strcmp (method, "GET")) | 55 | if (0 != strcmp (method, "GET")) |
56 | return MHD_NO; /* unexpected method */ | 56 | return MHD_NO; /* unexpected method */ |
57 | if (&aptr != *ptr) | 57 | if (&aptr != *req_cls) |
58 | { | 58 | { |
59 | /* do never respond on first call */ | 59 | /* do never respond on first call */ |
60 | *ptr = &aptr; | 60 | *req_cls = &aptr; |
61 | return MHD_YES; | 61 | return MHD_YES; |
62 | } | 62 | } |
63 | *ptr = NULL; /* reset when done */ | 63 | *req_cls = NULL; /* reset when done */ |
64 | response = MHD_create_response_from_buffer (strlen (me), | 64 | response = MHD_create_response_from_buffer (strlen (me), |
65 | (void *) me, | 65 | (void *) me, |
66 | MHD_RESPMEM_PERSISTENT); | 66 | MHD_RESPMEM_PERSISTENT); |
@@ -75,7 +75,7 @@ ahc_echo (void *cls, | |||
75 | static void | 75 | static void |
76 | request_completed (void *cls, | 76 | request_completed (void *cls, |
77 | struct MHD_Connection *connection, | 77 | struct MHD_Connection *connection, |
78 | void **con_cls, | 78 | void **req_cls, |
79 | enum MHD_RequestTerminationCode toe) | 79 | enum MHD_RequestTerminationCode toe) |
80 | { | 80 | { |
81 | fprintf (stderr, | 81 | fprintf (stderr, |
diff --git a/src/examples/demo.c b/src/examples/demo.c index 0b6dc5f9..6ff7adae 100644 --- a/src/examples/demo.c +++ b/src/examples/demo.c | |||
@@ -619,7 +619,7 @@ process_upload_data (void *cls, | |||
619 | * | 619 | * |
620 | * @param cls client-defined closure, NULL | 620 | * @param cls client-defined closure, NULL |
621 | * @param connection connection handle | 621 | * @param connection connection handle |
622 | * @param con_cls value as set by the last call to | 622 | * @param req_cls value as set by the last call to |
623 | * the MHD_AccessHandlerCallback, points to NULL if this was | 623 | * the MHD_AccessHandlerCallback, points to NULL if this was |
624 | * not an upload | 624 | * not an upload |
625 | * @param toe reason for request termination | 625 | * @param toe reason for request termination |
@@ -627,10 +627,10 @@ process_upload_data (void *cls, | |||
627 | static void | 627 | static void |
628 | response_completed_callback (void *cls, | 628 | response_completed_callback (void *cls, |
629 | struct MHD_Connection *connection, | 629 | struct MHD_Connection *connection, |
630 | void **con_cls, | 630 | void **req_cls, |
631 | enum MHD_RequestTerminationCode toe) | 631 | enum MHD_RequestTerminationCode toe) |
632 | { | 632 | { |
633 | struct UploadContext *uc = *con_cls; | 633 | struct UploadContext *uc = *req_cls; |
634 | (void) cls; /* Unused. Silent compiler warning. */ | 634 | (void) cls; /* Unused. Silent compiler warning. */ |
635 | (void) connection; /* Unused. Silent compiler warning. */ | 635 | (void) connection; /* Unused. Silent compiler warning. */ |
636 | (void) toe; /* Unused. Silent compiler warning. */ | 636 | (void) toe; /* Unused. Silent compiler warning. */ |
@@ -694,7 +694,7 @@ return_directory_response (struct MHD_Connection *connection) | |||
694 | * @param version HTTP version | 694 | * @param version HTTP version |
695 | * @param upload_data data from upload (PUT/POST) | 695 | * @param upload_data data from upload (PUT/POST) |
696 | * @param upload_data_size number of bytes in @a upload_data | 696 | * @param upload_data_size number of bytes in @a upload_data |
697 | * @param ptr our context | 697 | * @param req_cls our context |
698 | * @return #MHD_YES on success, #MHD_NO to drop connection | 698 | * @return #MHD_YES on success, #MHD_NO to drop connection |
699 | */ | 699 | */ |
700 | static enum MHD_Result | 700 | static enum MHD_Result |
@@ -704,7 +704,7 @@ generate_page (void *cls, | |||
704 | const char *method, | 704 | const char *method, |
705 | const char *version, | 705 | const char *version, |
706 | const char *upload_data, | 706 | const char *upload_data, |
707 | size_t *upload_data_size, void **ptr) | 707 | size_t *upload_data_size, void **req_cls) |
708 | { | 708 | { |
709 | struct MHD_Response *response; | 709 | struct MHD_Response *response; |
710 | enum MHD_Result ret; | 710 | enum MHD_Result ret; |
@@ -775,7 +775,7 @@ generate_page (void *cls, | |||
775 | if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) | 775 | if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) |
776 | { | 776 | { |
777 | /* upload! */ | 777 | /* upload! */ |
778 | struct UploadContext *uc = *ptr; | 778 | struct UploadContext *uc = *req_cls; |
779 | 779 | ||
780 | if (NULL == uc) | 780 | if (NULL == uc) |
781 | { | 781 | { |
@@ -793,7 +793,7 @@ generate_page (void *cls, | |||
793 | free (uc); | 793 | free (uc); |
794 | return MHD_NO; | 794 | return MHD_NO; |
795 | } | 795 | } |
796 | *ptr = uc; | 796 | *req_cls = uc; |
797 | return MHD_YES; | 797 | return MHD_YES; |
798 | } | 798 | } |
799 | if (0 != *upload_data_size) | 799 | if (0 != *upload_data_size) |
diff --git a/src/examples/demo_https.c b/src/examples/demo_https.c index d4e1d77f..ef59e7d9 100644 --- a/src/examples/demo_https.c +++ b/src/examples/demo_https.c | |||
@@ -621,7 +621,7 @@ process_upload_data (void *cls, | |||
621 | * | 621 | * |
622 | * @param cls client-defined closure, NULL | 622 | * @param cls client-defined closure, NULL |
623 | * @param connection connection handle | 623 | * @param connection connection handle |
624 | * @param con_cls value as set by the last call to | 624 | * @param req_cls value as set by the last call to |
625 | * the MHD_AccessHandlerCallback, points to NULL if this was | 625 | * the MHD_AccessHandlerCallback, points to NULL if this was |
626 | * not an upload | 626 | * not an upload |
627 | * @param toe reason for request termination | 627 | * @param toe reason for request termination |
@@ -629,10 +629,10 @@ process_upload_data (void *cls, | |||
629 | static void | 629 | static void |
630 | response_completed_callback (void *cls, | 630 | response_completed_callback (void *cls, |
631 | struct MHD_Connection *connection, | 631 | struct MHD_Connection *connection, |
632 | void **con_cls, | 632 | void **req_cls, |
633 | enum MHD_RequestTerminationCode toe) | 633 | enum MHD_RequestTerminationCode toe) |
634 | { | 634 | { |
635 | struct UploadContext *uc = *con_cls; | 635 | struct UploadContext *uc = *req_cls; |
636 | (void) cls; /* Unused. Silent compiler warning. */ | 636 | (void) cls; /* Unused. Silent compiler warning. */ |
637 | (void) connection; /* Unused. Silent compiler warning. */ | 637 | (void) connection; /* Unused. Silent compiler warning. */ |
638 | (void) toe; /* Unused. Silent compiler warning. */ | 638 | (void) toe; /* Unused. Silent compiler warning. */ |
@@ -696,7 +696,7 @@ return_directory_response (struct MHD_Connection *connection) | |||
696 | * @param version HTTP version | 696 | * @param version HTTP version |
697 | * @param upload_data data from upload (PUT/POST) | 697 | * @param upload_data data from upload (PUT/POST) |
698 | * @param upload_data_size number of bytes in "upload_data" | 698 | * @param upload_data_size number of bytes in "upload_data" |
699 | * @param ptr our context | 699 | * @param req_cls our context |
700 | * @return #MHD_YES on success, #MHD_NO to drop connection | 700 | * @return #MHD_YES on success, #MHD_NO to drop connection |
701 | */ | 701 | */ |
702 | static enum MHD_Result | 702 | static enum MHD_Result |
@@ -706,7 +706,7 @@ generate_page (void *cls, | |||
706 | const char *method, | 706 | const char *method, |
707 | const char *version, | 707 | const char *version, |
708 | const char *upload_data, | 708 | const char *upload_data, |
709 | size_t *upload_data_size, void **ptr) | 709 | size_t *upload_data_size, void **req_cls) |
710 | { | 710 | { |
711 | struct MHD_Response *response; | 711 | struct MHD_Response *response; |
712 | enum MHD_Result ret; | 712 | enum MHD_Result ret; |
@@ -776,7 +776,7 @@ generate_page (void *cls, | |||
776 | if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) | 776 | if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) |
777 | { | 777 | { |
778 | /* upload! */ | 778 | /* upload! */ |
779 | struct UploadContext *uc = *ptr; | 779 | struct UploadContext *uc = *req_cls; |
780 | 780 | ||
781 | if (NULL == uc) | 781 | if (NULL == uc) |
782 | { | 782 | { |
@@ -794,7 +794,7 @@ generate_page (void *cls, | |||
794 | free (uc); | 794 | free (uc); |
795 | return MHD_NO; | 795 | return MHD_NO; |
796 | } | 796 | } |
797 | *ptr = uc; | 797 | *req_cls = uc; |
798 | return MHD_YES; | 798 | return MHD_YES; |
799 | } | 799 | } |
800 | if (0 != *upload_data_size) | 800 | if (0 != *upload_data_size) |
diff --git a/src/examples/digest_auth_example.c b/src/examples/digest_auth_example.c index 073726ad..44faefeb 100644 --- a/src/examples/digest_auth_example.c +++ b/src/examples/digest_auth_example.c | |||
@@ -40,7 +40,7 @@ ahc_echo (void *cls, | |||
40 | const char *url, | 40 | const char *url, |
41 | const char *method, | 41 | const char *method, |
42 | const char *version, | 42 | const char *version, |
43 | const char *upload_data, size_t *upload_data_size, void **ptr) | 43 | const char *upload_data, size_t *upload_data_size, void **req_cls) |
44 | { | 44 | { |
45 | struct MHD_Response *response; | 45 | struct MHD_Response *response; |
46 | char *username; | 46 | char *username; |
@@ -54,7 +54,7 @@ ahc_echo (void *cls, | |||
54 | (void) version; /* Unused. Silent compiler warning. */ | 54 | (void) version; /* Unused. Silent compiler warning. */ |
55 | (void) upload_data; /* Unused. Silent compiler warning. */ | 55 | (void) upload_data; /* Unused. Silent compiler warning. */ |
56 | (void) upload_data_size; /* Unused. Silent compiler warning. */ | 56 | (void) upload_data_size; /* Unused. Silent compiler warning. */ |
57 | (void) ptr; /* Unused. Silent compiler warning. */ | 57 | (void) req_cls; /* Unused. Silent compiler warning. */ |
58 | 58 | ||
59 | username = MHD_digest_auth_get_username (connection); | 59 | username = MHD_digest_auth_get_username (connection); |
60 | if (NULL == username) | 60 | if (NULL == username) |
diff --git a/src/examples/dual_stack_example.c b/src/examples/dual_stack_example.c index 15bafc44..175583ac 100644 --- a/src/examples/dual_stack_example.c +++ b/src/examples/dual_stack_example.c | |||
@@ -34,7 +34,7 @@ ahc_echo (void *cls, | |||
34 | const char *url, | 34 | const char *url, |
35 | const char *method, | 35 | const char *method, |
36 | const char *version, | 36 | const char *version, |
37 | const char *upload_data, size_t *upload_data_size, void **ptr) | 37 | const char *upload_data, size_t *upload_data_size, void **req_cls) |
38 | { | 38 | { |
39 | static int aptr; | 39 | static int aptr; |
40 | const char *me = cls; | 40 | const char *me = cls; |
@@ -47,13 +47,13 @@ ahc_echo (void *cls, | |||
47 | 47 | ||
48 | if (0 != strcmp (method, "GET")) | 48 | if (0 != strcmp (method, "GET")) |
49 | return MHD_NO; /* unexpected method */ | 49 | return MHD_NO; /* unexpected method */ |
50 | if (&aptr != *ptr) | 50 | if (&aptr != *req_cls) |
51 | { | 51 | { |
52 | /* do never respond on first call */ | 52 | /* do never respond on first call */ |
53 | *ptr = &aptr; | 53 | *req_cls = &aptr; |
54 | return MHD_YES; | 54 | return MHD_YES; |
55 | } | 55 | } |
56 | *ptr = NULL; /* reset when done */ | 56 | *req_cls = NULL; /* reset when done */ |
57 | response = MHD_create_response_from_buffer (strlen (me), | 57 | response = MHD_create_response_from_buffer (strlen (me), |
58 | (void *) me, | 58 | (void *) me, |
59 | MHD_RESPMEM_PERSISTENT); | 59 | MHD_RESPMEM_PERSISTENT); |
diff --git a/src/examples/fileserver_example.c b/src/examples/fileserver_example.c index 94c2ca95..76879eec 100644 --- a/src/examples/fileserver_example.c +++ b/src/examples/fileserver_example.c | |||
@@ -48,7 +48,7 @@ ahc_echo (void *cls, | |||
48 | const char *method, | 48 | const char *method, |
49 | const char *version, | 49 | const char *version, |
50 | const char *upload_data, | 50 | const char *upload_data, |
51 | size_t *upload_data_size, void **ptr) | 51 | size_t *upload_data_size, void **req_cls) |
52 | { | 52 | { |
53 | static int aptr; | 53 | static int aptr; |
54 | struct MHD_Response *response; | 54 | struct MHD_Response *response; |
@@ -63,13 +63,13 @@ ahc_echo (void *cls, | |||
63 | if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) && | 63 | if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) && |
64 | (0 != strcmp (method, MHD_HTTP_METHOD_HEAD)) ) | 64 | (0 != strcmp (method, MHD_HTTP_METHOD_HEAD)) ) |
65 | return MHD_NO; /* unexpected method */ | 65 | return MHD_NO; /* unexpected method */ |
66 | if (&aptr != *ptr) | 66 | if (&aptr != *req_cls) |
67 | { | 67 | { |
68 | /* do never respond on first call */ | 68 | /* do never respond on first call */ |
69 | *ptr = &aptr; | 69 | *req_cls = &aptr; |
70 | return MHD_YES; | 70 | return MHD_YES; |
71 | } | 71 | } |
72 | *ptr = NULL; /* reset when done */ | 72 | *req_cls = NULL; /* reset when done */ |
73 | /* WARNING: direct usage of url as filename is for example only! | 73 | /* WARNING: direct usage of url as filename is for example only! |
74 | * NEVER pass received data directly as parameter to file manipulation | 74 | * NEVER pass received data directly as parameter to file manipulation |
75 | * functions. Always check validity of data before using. | 75 | * functions. Always check validity of data before using. |
diff --git a/src/examples/fileserver_example_dirs.c b/src/examples/fileserver_example_dirs.c index e6c9ed1f..796cb42e 100644 --- a/src/examples/fileserver_example_dirs.c +++ b/src/examples/fileserver_example_dirs.c | |||
@@ -88,7 +88,7 @@ ahc_echo (void *cls, | |||
88 | const char *method, | 88 | const char *method, |
89 | const char *version, | 89 | const char *version, |
90 | const char *upload_data, | 90 | const char *upload_data, |
91 | size_t *upload_data_size, void **ptr) | 91 | size_t *upload_data_size, void **req_cls) |
92 | { | 92 | { |
93 | static int aptr; | 93 | static int aptr; |
94 | struct MHD_Response *response; | 94 | struct MHD_Response *response; |
@@ -105,13 +105,13 @@ ahc_echo (void *cls, | |||
105 | 105 | ||
106 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) | 106 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) |
107 | return MHD_NO; /* unexpected method */ | 107 | return MHD_NO; /* unexpected method */ |
108 | if (&aptr != *ptr) | 108 | if (&aptr != *req_cls) |
109 | { | 109 | { |
110 | /* do never respond on first call */ | 110 | /* do never respond on first call */ |
111 | *ptr = &aptr; | 111 | *req_cls = &aptr; |
112 | return MHD_YES; | 112 | return MHD_YES; |
113 | } | 113 | } |
114 | *ptr = NULL; /* reset when done */ | 114 | *req_cls = NULL; /* reset when done */ |
115 | 115 | ||
116 | file = fopen (&url[1], "rb"); | 116 | file = fopen (&url[1], "rb"); |
117 | if (NULL != file) | 117 | if (NULL != file) |
diff --git a/src/examples/fileserver_example_external_select.c b/src/examples/fileserver_example_external_select.c index 7209751f..09f7be0a 100644 --- a/src/examples/fileserver_example_external_select.c +++ b/src/examples/fileserver_example_external_select.c | |||
@@ -55,7 +55,7 @@ ahc_echo (void *cls, | |||
55 | const char *method, | 55 | const char *method, |
56 | const char *version, | 56 | const char *version, |
57 | const char *upload_data, | 57 | const char *upload_data, |
58 | size_t *upload_data_size, void **ptr) | 58 | size_t *upload_data_size, void **req_cls) |
59 | { | 59 | { |
60 | static int aptr; | 60 | static int aptr; |
61 | struct MHD_Response *response; | 61 | struct MHD_Response *response; |
@@ -70,13 +70,13 @@ ahc_echo (void *cls, | |||
70 | 70 | ||
71 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) | 71 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) |
72 | return MHD_NO; /* unexpected method */ | 72 | return MHD_NO; /* unexpected method */ |
73 | if (&aptr != *ptr) | 73 | if (&aptr != *req_cls) |
74 | { | 74 | { |
75 | /* do never respond on first call */ | 75 | /* do never respond on first call */ |
76 | *ptr = &aptr; | 76 | *req_cls = &aptr; |
77 | return MHD_YES; | 77 | return MHD_YES; |
78 | } | 78 | } |
79 | *ptr = NULL; /* reset when done */ | 79 | *req_cls = NULL; /* reset when done */ |
80 | 80 | ||
81 | file = fopen (&url[1], "rb"); | 81 | file = fopen (&url[1], "rb"); |
82 | if (NULL != file) | 82 | if (NULL != file) |
diff --git a/src/examples/http_chunked_compression.c b/src/examples/http_chunked_compression.c index f6baf0fd..7b8ed1fc 100644 --- a/src/examples/http_chunked_compression.c +++ b/src/examples/http_chunked_compression.c | |||
@@ -156,7 +156,7 @@ free_cb (void *cls) | |||
156 | static enum MHD_Result | 156 | static enum MHD_Result |
157 | ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const | 157 | ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const |
158 | char *method, const char *version, | 158 | char *method, const char *version, |
159 | const char *upload_data, size_t *upload_size, void **ptr) | 159 | const char *upload_data, size_t *upload_size, void **req_cls) |
160 | { | 160 | { |
161 | struct Holder *holder; | 161 | struct Holder *holder; |
162 | struct MHD_Response *res; | 162 | struct MHD_Response *res; |
@@ -167,12 +167,12 @@ ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const | |||
167 | (void) version; | 167 | (void) version; |
168 | (void) upload_data; | 168 | (void) upload_data; |
169 | (void) upload_size; | 169 | (void) upload_size; |
170 | if (NULL == *ptr) | 170 | if (NULL == *req_cls) |
171 | { | 171 | { |
172 | *ptr = (void *) 1; | 172 | *req_cls = (void *) 1; |
173 | return MHD_YES; | 173 | return MHD_YES; |
174 | } | 174 | } |
175 | *ptr = NULL; | 175 | *req_cls = NULL; |
176 | holder = calloc (1, sizeof (struct Holder)); | 176 | holder = calloc (1, sizeof (struct Holder)); |
177 | if (! holder) | 177 | if (! holder) |
178 | return MHD_NO; | 178 | return MHD_NO; |
diff --git a/src/examples/http_compression.c b/src/examples/http_compression.c index 0419a803..a91a39a3 100644 --- a/src/examples/http_compression.c +++ b/src/examples/http_compression.c | |||
@@ -96,7 +96,7 @@ ahc_echo (void *cls, | |||
96 | const char *url, | 96 | const char *url, |
97 | const char *method, | 97 | const char *method, |
98 | const char *version, | 98 | const char *version, |
99 | const char *upload_data, size_t *upload_data_size, void **ptr) | 99 | const char *upload_data, size_t *upload_data_size, void **req_cls) |
100 | { | 100 | { |
101 | struct MHD_Response *response; | 101 | struct MHD_Response *response; |
102 | enum MHD_Result ret; | 102 | enum MHD_Result ret; |
@@ -111,12 +111,12 @@ ahc_echo (void *cls, | |||
111 | 111 | ||
112 | if (0 != strcmp (method, "GET")) | 112 | if (0 != strcmp (method, "GET")) |
113 | return MHD_NO; /* unexpected method */ | 113 | return MHD_NO; /* unexpected method */ |
114 | if (! *ptr) | 114 | if (! *req_cls) |
115 | { | 115 | { |
116 | *ptr = (void *) 1; | 116 | *req_cls = (void *) 1; |
117 | return MHD_YES; | 117 | return MHD_YES; |
118 | } | 118 | } |
119 | *ptr = NULL; | 119 | *req_cls = NULL; |
120 | 120 | ||
121 | body_str = strdup (PAGE); | 121 | body_str = strdup (PAGE); |
122 | if (NULL == body_str) | 122 | if (NULL == body_str) |
diff --git a/src/examples/https_fileserver_example.c b/src/examples/https_fileserver_example.c index babad604..5dc340f7 100644 --- a/src/examples/https_fileserver_example.c +++ b/src/examples/https_fileserver_example.c | |||
@@ -137,7 +137,7 @@ http_ahc (void *cls, | |||
137 | const char *method, | 137 | const char *method, |
138 | const char *version, | 138 | const char *version, |
139 | const char *upload_data, | 139 | const char *upload_data, |
140 | size_t *upload_data_size, void **ptr) | 140 | size_t *upload_data_size, void **req_cls) |
141 | { | 141 | { |
142 | static int aptr; | 142 | static int aptr; |
143 | struct MHD_Response *response; | 143 | struct MHD_Response *response; |
@@ -152,13 +152,13 @@ http_ahc (void *cls, | |||
152 | 152 | ||
153 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) | 153 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) |
154 | return MHD_NO; /* unexpected method */ | 154 | return MHD_NO; /* unexpected method */ |
155 | if (&aptr != *ptr) | 155 | if (&aptr != *req_cls) |
156 | { | 156 | { |
157 | /* do never respond on first call */ | 157 | /* do never respond on first call */ |
158 | *ptr = &aptr; | 158 | *req_cls = &aptr; |
159 | return MHD_YES; | 159 | return MHD_YES; |
160 | } | 160 | } |
161 | *ptr = NULL; /* reset when done */ | 161 | *req_cls = NULL; /* reset when done */ |
162 | 162 | ||
163 | file = fopen (&url[1], "rb"); | 163 | file = fopen (&url[1], "rb"); |
164 | if (NULL != file) | 164 | if (NULL != file) |
diff --git a/src/examples/minimal_example.c b/src/examples/minimal_example.c index a02b5d50..ce604555 100644 --- a/src/examples/minimal_example.c +++ b/src/examples/minimal_example.c | |||
@@ -36,7 +36,7 @@ ahc_echo (void *cls, | |||
36 | const char *version, | 36 | const char *version, |
37 | const char *upload_data, | 37 | const char *upload_data, |
38 | size_t *upload_data_size, | 38 | size_t *upload_data_size, |
39 | void **ptr) | 39 | void **req_cls) |
40 | { | 40 | { |
41 | static int aptr; | 41 | static int aptr; |
42 | const char *me = cls; | 42 | const char *me = cls; |
@@ -50,13 +50,13 @@ ahc_echo (void *cls, | |||
50 | 50 | ||
51 | if (0 != strcmp (method, "GET")) | 51 | if (0 != strcmp (method, "GET")) |
52 | return MHD_NO; /* unexpected method */ | 52 | return MHD_NO; /* unexpected method */ |
53 | if (&aptr != *ptr) | 53 | if (&aptr != *req_cls) |
54 | { | 54 | { |
55 | /* do never respond on first call */ | 55 | /* do never respond on first call */ |
56 | *ptr = &aptr; | 56 | *req_cls = &aptr; |
57 | return MHD_YES; | 57 | return MHD_YES; |
58 | } | 58 | } |
59 | *ptr = NULL; /* reset when done */ | 59 | *req_cls = NULL; /* reset when done */ |
60 | response = MHD_create_response_from_buffer (strlen (me), | 60 | response = MHD_create_response_from_buffer (strlen (me), |
61 | (void *) me, | 61 | (void *) me, |
62 | MHD_RESPMEM_PERSISTENT); | 62 | MHD_RESPMEM_PERSISTENT); |
diff --git a/src/examples/minimal_example_comet.c b/src/examples/minimal_example_comet.c index c36bf2ce..a8864d89 100644 --- a/src/examples/minimal_example_comet.c +++ b/src/examples/minimal_example_comet.c | |||
@@ -44,7 +44,7 @@ ahc_echo (void *cls, | |||
44 | const char *url, | 44 | const char *url, |
45 | const char *method, | 45 | const char *method, |
46 | const char *version, | 46 | const char *version, |
47 | const char *upload_data, size_t *upload_data_size, void **ptr) | 47 | const char *upload_data, size_t *upload_data_size, void **req_cls) |
48 | { | 48 | { |
49 | static int aptr; | 49 | static int aptr; |
50 | struct MHD_Response *response; | 50 | struct MHD_Response *response; |
@@ -57,13 +57,13 @@ ahc_echo (void *cls, | |||
57 | 57 | ||
58 | if (0 != strcmp (method, "GET")) | 58 | if (0 != strcmp (method, "GET")) |
59 | return MHD_NO; /* unexpected method */ | 59 | return MHD_NO; /* unexpected method */ |
60 | if (&aptr != *ptr) | 60 | if (&aptr != *req_cls) |
61 | { | 61 | { |
62 | /* do never respond on first call */ | 62 | /* do never respond on first call */ |
63 | *ptr = &aptr; | 63 | *req_cls = &aptr; |
64 | return MHD_YES; | 64 | return MHD_YES; |
65 | } | 65 | } |
66 | *ptr = NULL; /* reset when done */ | 66 | *req_cls = NULL; /* reset when done */ |
67 | response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, | 67 | response = MHD_create_response_from_callback (MHD_SIZE_UNKNOWN, |
68 | 80, | 68 | 80, |
69 | &data_generator, NULL, NULL); | 69 | &data_generator, NULL, NULL); |
diff --git a/src/examples/minimal_example_empty.c b/src/examples/minimal_example_empty.c index d692e0d8..43719a24 100644 --- a/src/examples/minimal_example_empty.c +++ b/src/examples/minimal_example_empty.c | |||
@@ -34,7 +34,7 @@ ahc_echo (void *cls, | |||
34 | const char *version, | 34 | const char *version, |
35 | const char *upload_data, | 35 | const char *upload_data, |
36 | size_t *upload_data_size, | 36 | size_t *upload_data_size, |
37 | void **ptr) | 37 | void **req_cls) |
38 | { | 38 | { |
39 | static int aptr; | 39 | static int aptr; |
40 | struct MHD_Response *response; | 40 | struct MHD_Response *response; |
@@ -48,13 +48,13 @@ ahc_echo (void *cls, | |||
48 | 48 | ||
49 | if (0 != strcmp (method, "GET")) | 49 | if (0 != strcmp (method, "GET")) |
50 | return MHD_NO; /* unexpected method */ | 50 | return MHD_NO; /* unexpected method */ |
51 | if (&aptr != *ptr) | 51 | if (&aptr != *req_cls) |
52 | { | 52 | { |
53 | /* do never respond on first call */ | 53 | /* do never respond on first call */ |
54 | *ptr = &aptr; | 54 | *req_cls = &aptr; |
55 | return MHD_YES; | 55 | return MHD_YES; |
56 | } | 56 | } |
57 | *ptr = NULL; /* reset when done */ | 57 | *req_cls = NULL; /* reset when done */ |
58 | response = MHD_create_response_from_buffer (0, | 58 | response = MHD_create_response_from_buffer (0, |
59 | NULL, | 59 | NULL, |
60 | MHD_RESPMEM_PERSISTENT); | 60 | MHD_RESPMEM_PERSISTENT); |
diff --git a/src/examples/minimal_example_empty_tls.c b/src/examples/minimal_example_empty_tls.c index 70d7bd71..f03884c8 100644 --- a/src/examples/minimal_example_empty_tls.c +++ b/src/examples/minimal_example_empty_tls.c | |||
@@ -34,7 +34,7 @@ ahc_echo (void *cls, | |||
34 | const char *version, | 34 | const char *version, |
35 | const char *upload_data, | 35 | const char *upload_data, |
36 | size_t *upload_data_size, | 36 | size_t *upload_data_size, |
37 | void **ptr) | 37 | void **req_cls) |
38 | { | 38 | { |
39 | static int aptr; | 39 | static int aptr; |
40 | struct MHD_Response *response; | 40 | struct MHD_Response *response; |
@@ -48,13 +48,13 @@ ahc_echo (void *cls, | |||
48 | 48 | ||
49 | if (0 != strcmp (method, "GET")) | 49 | if (0 != strcmp (method, "GET")) |
50 | return MHD_NO; /* unexpected method */ | 50 | return MHD_NO; /* unexpected method */ |
51 | if (&aptr != *ptr) | 51 | if (&aptr != *req_cls) |
52 | { | 52 | { |
53 | /* do never respond on first call */ | 53 | /* do never respond on first call */ |
54 | *ptr = &aptr; | 54 | *req_cls = &aptr; |
55 | return MHD_YES; | 55 | return MHD_YES; |
56 | } | 56 | } |
57 | *ptr = NULL; /* reset when done */ | 57 | *req_cls = NULL; /* reset when done */ |
58 | response = MHD_create_response_from_buffer (0, | 58 | response = MHD_create_response_from_buffer (0, |
59 | NULL, | 59 | NULL, |
60 | MHD_RESPMEM_PERSISTENT); | 60 | MHD_RESPMEM_PERSISTENT); |
diff --git a/src/examples/msgs_i18n.c b/src/examples/msgs_i18n.c index 56f9f501..5d563e4f 100644 --- a/src/examples/msgs_i18n.c +++ b/src/examples/msgs_i18n.c | |||
@@ -51,7 +51,7 @@ ahc_echo (void *cls, | |||
51 | const char *ver, | 51 | const char *ver, |
52 | const char *upd, | 52 | const char *upd, |
53 | size_t *upsz, | 53 | size_t *upsz, |
54 | void **ptr) | 54 | void **req_cls) |
55 | { | 55 | { |
56 | return MHD_NO; | 56 | return MHD_NO; |
57 | } | 57 | } |
diff --git a/src/examples/post_example.c b/src/examples/post_example.c index 9f4fbcf9..d8f58d49 100644 --- a/src/examples/post_example.c +++ b/src/examples/post_example.c | |||
@@ -540,7 +540,7 @@ post_iterator (void *cls, | |||
540 | * @param upload_data_size set initially to the size of the | 540 | * @param upload_data_size set initially to the size of the |
541 | * upload_data provided; the method must update this | 541 | * upload_data provided; the method must update this |
542 | * value to the number of bytes NOT processed; | 542 | * value to the number of bytes NOT processed; |
543 | * @param ptr pointer that the callback can set to some | 543 | * @param req_cls pointer that the callback can set to some |
544 | * address and that will be preserved by MHD for future | 544 | * address and that will be preserved by MHD for future |
545 | * calls for this request; since the access handler may | 545 | * calls for this request; since the access handler may |
546 | * be called many times (i.e., for a PUT/POST operation | 546 | * be called many times (i.e., for a PUT/POST operation |
@@ -549,7 +549,7 @@ post_iterator (void *cls, | |||
549 | * If necessary, this state can be cleaned up in the | 549 | * If necessary, this state can be cleaned up in the |
550 | * global "MHD_RequestCompleted" callback (which | 550 | * global "MHD_RequestCompleted" callback (which |
551 | * can be set with the MHD_OPTION_NOTIFY_COMPLETED). | 551 | * can be set with the MHD_OPTION_NOTIFY_COMPLETED). |
552 | * Initially, <tt>*con_cls</tt> will be NULL. | 552 | * Initially, <tt>*req_cls</tt> will be NULL. |
553 | * @return MHS_YES if the connection was handled successfully, | 553 | * @return MHS_YES if the connection was handled successfully, |
554 | * MHS_NO if the socket must be closed due to a serious | 554 | * MHS_NO if the socket must be closed due to a serious |
555 | * error while handling the request | 555 | * error while handling the request |
@@ -562,7 +562,7 @@ create_response (void *cls, | |||
562 | const char *version, | 562 | const char *version, |
563 | const char *upload_data, | 563 | const char *upload_data, |
564 | size_t *upload_data_size, | 564 | size_t *upload_data_size, |
565 | void **ptr) | 565 | void **req_cls) |
566 | { | 566 | { |
567 | struct MHD_Response *response; | 567 | struct MHD_Response *response; |
568 | struct Request *request; | 568 | struct Request *request; |
@@ -572,7 +572,7 @@ create_response (void *cls, | |||
572 | (void) cls; /* Unused. Silent compiler warning. */ | 572 | (void) cls; /* Unused. Silent compiler warning. */ |
573 | (void) version; /* Unused. Silent compiler warning. */ | 573 | (void) version; /* Unused. Silent compiler warning. */ |
574 | 574 | ||
575 | request = *ptr; | 575 | request = *req_cls; |
576 | if (NULL == request) | 576 | if (NULL == request) |
577 | { | 577 | { |
578 | request = calloc (1, sizeof (struct Request)); | 578 | request = calloc (1, sizeof (struct Request)); |
@@ -581,7 +581,7 @@ create_response (void *cls, | |||
581 | fprintf (stderr, "calloc error: %s\n", strerror (errno)); | 581 | fprintf (stderr, "calloc error: %s\n", strerror (errno)); |
582 | return MHD_NO; | 582 | return MHD_NO; |
583 | } | 583 | } |
584 | *ptr = request; | 584 | *req_cls = request; |
585 | if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) | 585 | if (0 == strcmp (method, MHD_HTTP_METHOD_POST)) |
586 | { | 586 | { |
587 | request->pp = MHD_create_post_processor (connection, 1024, | 587 | request->pp = MHD_create_post_processor (connection, 1024, |
@@ -660,16 +660,16 @@ create_response (void *cls, | |||
660 | * | 660 | * |
661 | * @param cls not used | 661 | * @param cls not used |
662 | * @param connection connection that completed | 662 | * @param connection connection that completed |
663 | * @param con_cls session handle | 663 | * @param req_cls session handle |
664 | * @param toe status code | 664 | * @param toe status code |
665 | */ | 665 | */ |
666 | static void | 666 | static void |
667 | request_completed_callback (void *cls, | 667 | request_completed_callback (void *cls, |
668 | struct MHD_Connection *connection, | 668 | struct MHD_Connection *connection, |
669 | void **con_cls, | 669 | void **req_cls, |
670 | enum MHD_RequestTerminationCode toe) | 670 | enum MHD_RequestTerminationCode toe) |
671 | { | 671 | { |
672 | struct Request *request = *con_cls; | 672 | struct Request *request = *req_cls; |
673 | (void) cls; /* Unused. Silent compiler warning. */ | 673 | (void) cls; /* Unused. Silent compiler warning. */ |
674 | (void) connection; /* Unused. Silent compiler warning. */ | 674 | (void) connection; /* Unused. Silent compiler warning. */ |
675 | (void) toe; /* Unused. Silent compiler warning. */ | 675 | (void) toe; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/querystring_example.c b/src/examples/querystring_example.c index 975d17f2..d33767cb 100644 --- a/src/examples/querystring_example.c +++ b/src/examples/querystring_example.c | |||
@@ -35,7 +35,7 @@ ahc_echo (void *cls, | |||
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, size_t *upload_data_size, void **ptr) | 38 | const char *upload_data, size_t *upload_data_size, void **req_cls) |
39 | { | 39 | { |
40 | static int aptr; | 40 | static int aptr; |
41 | const char *fmt = cls; | 41 | const char *fmt = cls; |
@@ -51,13 +51,13 @@ ahc_echo (void *cls, | |||
51 | 51 | ||
52 | if (0 != strcmp (method, "GET")) | 52 | if (0 != strcmp (method, "GET")) |
53 | return MHD_NO; /* unexpected method */ | 53 | return MHD_NO; /* unexpected method */ |
54 | if (&aptr != *ptr) | 54 | if (&aptr != *req_cls) |
55 | { | 55 | { |
56 | /* do never respond on first call */ | 56 | /* do never respond on first call */ |
57 | *ptr = &aptr; | 57 | *req_cls = &aptr; |
58 | return MHD_YES; | 58 | return MHD_YES; |
59 | } | 59 | } |
60 | *ptr = NULL; /* reset when done */ | 60 | *req_cls = NULL; /* reset when done */ |
61 | if (NULL == fmt) | 61 | if (NULL == fmt) |
62 | return MHD_NO; /* The cls must not be NULL */ | 62 | return MHD_NO; /* The cls must not be NULL */ |
63 | val = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "q"); | 63 | val = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "q"); |
diff --git a/src/examples/refuse_post_example.c b/src/examples/refuse_post_example.c index 7e100d9f..dc261575 100644 --- a/src/examples/refuse_post_example.c +++ b/src/examples/refuse_post_example.c | |||
@@ -41,7 +41,7 @@ ahc_echo (void *cls, | |||
41 | const char *url, | 41 | const char *url, |
42 | const char *method, | 42 | const char *method, |
43 | const char *version, | 43 | const char *version, |
44 | const char *upload_data, size_t *upload_data_size, void **ptr) | 44 | const char *upload_data, size_t *upload_data_size, void **req_cls) |
45 | { | 45 | { |
46 | static int aptr; | 46 | static int aptr; |
47 | const char *me = cls; | 47 | const char *me = cls; |
@@ -56,9 +56,9 @@ ahc_echo (void *cls, | |||
56 | if ((0 != strcmp (method, "GET")) && (0 != strcmp (method, "POST"))) | 56 | if ((0 != strcmp (method, "GET")) && (0 != strcmp (method, "POST"))) |
57 | return MHD_NO; /* unexpected method */ | 57 | return MHD_NO; /* unexpected method */ |
58 | 58 | ||
59 | if (&aptr != *ptr) | 59 | if (&aptr != *req_cls) |
60 | { | 60 | { |
61 | *ptr = &aptr; | 61 | *req_cls = &aptr; |
62 | 62 | ||
63 | /* always to busy for POST requests */ | 63 | /* always to busy for POST requests */ |
64 | if (0 == strcmp (method, "POST")) | 64 | if (0 == strcmp (method, "POST")) |
@@ -74,7 +74,7 @@ ahc_echo (void *cls, | |||
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
77 | *ptr = NULL; /* reset when done */ | 77 | *req_cls = NULL; /* reset when done */ |
78 | response = MHD_create_response_from_buffer (strlen (me), | 78 | response = MHD_create_response_from_buffer (strlen (me), |
79 | (void *) me, | 79 | (void *) me, |
80 | MHD_RESPMEM_PERSISTENT); | 80 | MHD_RESPMEM_PERSISTENT); |
diff --git a/src/examples/suspend_resume_epoll.c b/src/examples/suspend_resume_epoll.c index d25c3b21..6b660b00 100644 --- a/src/examples/suspend_resume_epoll.c +++ b/src/examples/suspend_resume_epoll.c | |||
@@ -49,7 +49,7 @@ ahc_echo (void *cls, | |||
49 | const char *url, | 49 | const char *url, |
50 | const char *method, | 50 | const char *method, |
51 | const char *version, | 51 | const char *version, |
52 | const char *upload_data, size_t *upload_data_size, void **ptr) | 52 | const char *upload_data, size_t *upload_data_size, void **req_cls) |
53 | { | 53 | { |
54 | struct MHD_Response *response; | 54 | struct MHD_Response *response; |
55 | enum MHD_Result ret; | 55 | enum MHD_Result ret; |
@@ -62,7 +62,7 @@ ahc_echo (void *cls, | |||
62 | (void) version; /* Unused. Silence compiler warning. */ | 62 | (void) version; /* Unused. Silence compiler warning. */ |
63 | (void) upload_data; /* Unused. Silence compiler warning. */ | 63 | (void) upload_data; /* Unused. Silence compiler warning. */ |
64 | (void) upload_data_size; /* Unused. Silence compiler warning. */ | 64 | (void) upload_data_size; /* Unused. Silence compiler warning. */ |
65 | req = *ptr; | 65 | req = *req_cls; |
66 | if (NULL == req) | 66 | if (NULL == req) |
67 | { | 67 | { |
68 | 68 | ||
@@ -71,7 +71,7 @@ ahc_echo (void *cls, | |||
71 | return MHD_NO; | 71 | return MHD_NO; |
72 | req->connection = connection; | 72 | req->connection = connection; |
73 | req->timerfd = -1; | 73 | req->timerfd = -1; |
74 | *ptr = req; | 74 | *req_cls = req; |
75 | return MHD_YES; | 75 | return MHD_YES; |
76 | } | 76 | } |
77 | 77 | ||
@@ -120,10 +120,10 @@ ahc_echo (void *cls, | |||
120 | static void | 120 | static void |
121 | connection_done (void *cls, | 121 | connection_done (void *cls, |
122 | struct MHD_Connection *connection, | 122 | struct MHD_Connection *connection, |
123 | void **con_cls, | 123 | void **req_cls, |
124 | enum MHD_RequestTerminationCode toe) | 124 | enum MHD_RequestTerminationCode toe) |
125 | { | 125 | { |
126 | struct Request *req = *con_cls; | 126 | struct Request *req = *req_cls; |
127 | 127 | ||
128 | (void) cls; | 128 | (void) cls; |
129 | (void) connection; | 129 | (void) connection; |
diff --git a/src/examples/timeout.c b/src/examples/timeout.c index b31ff21f..b52f508f 100644 --- a/src/examples/timeout.c +++ b/src/examples/timeout.c | |||
@@ -37,7 +37,7 @@ answer_to_connection (void *cls, | |||
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 **req_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; |
@@ -48,7 +48,7 @@ answer_to_connection (void *cls, | |||
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) req_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, |
diff --git a/src/examples/upgrade_example.c b/src/examples/upgrade_example.c index 08c718d0..547f1b6c 100644 --- a/src/examples/upgrade_example.c +++ b/src/examples/upgrade_example.c | |||
@@ -169,7 +169,7 @@ run_usock (void *cls) | |||
169 | * @param connection original HTTP connection handle, | 169 | * @param connection original HTTP connection handle, |
170 | * giving the function a last chance | 170 | * giving the function a last chance |
171 | * to inspect the original HTTP request | 171 | * to inspect the original HTTP request |
172 | * @param con_cls last value left in `con_cls` of the `MHD_AccessHandlerCallback` | 172 | * @param req_cls last value left in `req_cls` of the `MHD_AccessHandlerCallback` |
173 | * @param extra_in if we happened to have read bytes after the | 173 | * @param extra_in if we happened to have read bytes after the |
174 | * HTTP header already (because the client sent | 174 | * HTTP header already (because the client sent |
175 | * more than the HTTP header of the request before | 175 | * more than the HTTP header of the request before |
@@ -194,7 +194,7 @@ run_usock (void *cls) | |||
194 | static void | 194 | static void |
195 | uh_cb (void *cls, | 195 | uh_cb (void *cls, |
196 | struct MHD_Connection *connection, | 196 | struct MHD_Connection *connection, |
197 | void *con_cls, | 197 | void *req_cls, |
198 | const char *extra_in, | 198 | const char *extra_in, |
199 | size_t extra_in_size, | 199 | size_t extra_in_size, |
200 | MHD_socket sock, | 200 | MHD_socket sock, |
@@ -204,7 +204,7 @@ uh_cb (void *cls, | |||
204 | pthread_t pt; | 204 | pthread_t pt; |
205 | (void) cls; /* Unused. Silent compiler warning. */ | 205 | (void) cls; /* Unused. Silent compiler warning. */ |
206 | (void) connection; /* Unused. Silent compiler warning. */ | 206 | (void) connection; /* Unused. Silent compiler warning. */ |
207 | (void) con_cls; /* Unused. Silent compiler warning. */ | 207 | (void) req_cls; /* Unused. Silent compiler warning. */ |
208 | 208 | ||
209 | md = malloc (sizeof (struct MyData)); | 209 | md = malloc (sizeof (struct MyData)); |
210 | if (NULL == md) | 210 | if (NULL == md) |
@@ -247,7 +247,7 @@ ahc_echo (void *cls, | |||
247 | const char *version, | 247 | const char *version, |
248 | const char *upload_data, | 248 | const char *upload_data, |
249 | size_t *upload_data_size, | 249 | size_t *upload_data_size, |
250 | void **ptr) | 250 | void **req_cls) |
251 | { | 251 | { |
252 | static int aptr; | 252 | static int aptr; |
253 | struct MHD_Response *response; | 253 | struct MHD_Response *response; |
@@ -260,13 +260,13 @@ ahc_echo (void *cls, | |||
260 | 260 | ||
261 | if (0 != strcmp (method, "GET")) | 261 | if (0 != strcmp (method, "GET")) |
262 | return MHD_NO; /* unexpected method */ | 262 | return MHD_NO; /* unexpected method */ |
263 | if (&aptr != *ptr) | 263 | if (&aptr != *req_cls) |
264 | { | 264 | { |
265 | /* do never respond on first call */ | 265 | /* do never respond on first call */ |
266 | *ptr = &aptr; | 266 | *req_cls = &aptr; |
267 | return MHD_YES; | 267 | return MHD_YES; |
268 | } | 268 | } |
269 | *ptr = NULL; /* reset when done */ | 269 | *req_cls = NULL; /* reset when done */ |
270 | response = MHD_create_response_for_upgrade (&uh_cb, | 270 | response = MHD_create_response_for_upgrade (&uh_cb, |
271 | NULL); | 271 | NULL); |
272 | 272 | ||
diff --git a/src/examples/websocket_chatserver_example.c b/src/examples/websocket_chatserver_example.c index 0c39d5f0..052b4221 100644 --- a/src/examples/websocket_chatserver_example.c +++ b/src/examples/websocket_chatserver_example.c | |||
@@ -2044,7 +2044,7 @@ connecteduser_receive_messages (void *cls) | |||
2044 | * @param connection original HTTP connection handle, | 2044 | * @param connection original HTTP connection handle, |
2045 | * giving the function a last chance | 2045 | * giving the function a last chance |
2046 | * to inspect the original HTTP request | 2046 | * to inspect the original HTTP request |
2047 | * @param con_cls last value left in `con_cls` of the `MHD_AccessHandlerCallback` | 2047 | * @param req_cls last value left in `req_cls` of the `MHD_AccessHandlerCallback` |
2048 | * @param extra_in if we happened to have read bytes after the | 2048 | * @param extra_in if we happened to have read bytes after the |
2049 | * HTTP header already (because the client sent | 2049 | * HTTP header already (because the client sent |
2050 | * more than the HTTP header of the request before | 2050 | * more than the HTTP header of the request before |
@@ -2069,7 +2069,7 @@ connecteduser_receive_messages (void *cls) | |||
2069 | static void | 2069 | static void |
2070 | upgrade_handler (void *cls, | 2070 | upgrade_handler (void *cls, |
2071 | struct MHD_Connection *connection, | 2071 | struct MHD_Connection *connection, |
2072 | void *con_cls, | 2072 | void *req_cls, |
2073 | const char *extra_in, | 2073 | const char *extra_in, |
2074 | size_t extra_in_size, | 2074 | size_t extra_in_size, |
2075 | MHD_socket fd, | 2075 | MHD_socket fd, |
@@ -2079,7 +2079,7 @@ upgrade_handler (void *cls, | |||
2079 | pthread_t pt; | 2079 | pthread_t pt; |
2080 | (void) cls; /* Unused. Silent compiler warning. */ | 2080 | (void) cls; /* Unused. Silent compiler warning. */ |
2081 | (void) connection; /* Unused. Silent compiler warning. */ | 2081 | (void) connection; /* Unused. Silent compiler warning. */ |
2082 | (void) con_cls; /* Unused. Silent compiler warning. */ | 2082 | (void) req_cls; /* Unused. Silent compiler warning. */ |
2083 | 2083 | ||
2084 | /* This callback must return as soon as possible. */ | 2084 | /* This callback must return as soon as possible. */ |
2085 | 2085 | ||
@@ -2130,7 +2130,7 @@ upgrade_handler (void *cls, | |||
2130 | * @param version The HTTP version | 2130 | * @param version The HTTP version |
2131 | * @param upload_data Given upload data for POST requests | 2131 | * @param upload_data Given upload data for POST requests |
2132 | * @param upload_data_size The size of the upload data | 2132 | * @param upload_data_size The size of the upload data |
2133 | * @param ptr A pointer for request specific data | 2133 | * @param req_cls A pointer for request specific data |
2134 | * @return MHD_YES on success or MHD_NO on error. | 2134 | * @return MHD_YES on success or MHD_NO on error. |
2135 | */ | 2135 | */ |
2136 | static enum MHD_Result | 2136 | static enum MHD_Result |
@@ -2141,7 +2141,7 @@ access_handler (void *cls, | |||
2141 | const char *version, | 2141 | const char *version, |
2142 | const char *upload_data, | 2142 | const char *upload_data, |
2143 | size_t *upload_data_size, | 2143 | size_t *upload_data_size, |
2144 | void **ptr) | 2144 | void **req_cls) |
2145 | { | 2145 | { |
2146 | static int aptr; | 2146 | static int aptr; |
2147 | struct MHD_Response *response; | 2147 | struct MHD_Response *response; |
@@ -2153,13 +2153,13 @@ access_handler (void *cls, | |||
2153 | 2153 | ||
2154 | if (0 != strcmp (method, "GET")) | 2154 | if (0 != strcmp (method, "GET")) |
2155 | return MHD_NO; /* unexpected method */ | 2155 | return MHD_NO; /* unexpected method */ |
2156 | if (&aptr != *ptr) | 2156 | if (&aptr != *req_cls) |
2157 | { | 2157 | { |
2158 | /* do never respond on first call */ | 2158 | /* do never respond on first call */ |
2159 | *ptr = &aptr; | 2159 | *req_cls = &aptr; |
2160 | return MHD_YES; | 2160 | return MHD_YES; |
2161 | } | 2161 | } |
2162 | *ptr = NULL; /* reset when done */ | 2162 | *req_cls = NULL; /* reset when done */ |
2163 | if (0 == strcmp (url, "/")) | 2163 | if (0 == strcmp (url, "/")) |
2164 | { | 2164 | { |
2165 | /* Default page for visiting the server */ | 2165 | /* Default page for visiting the server */ |
diff --git a/src/examples/websocket_threaded_example.c b/src/examples/websocket_threaded_example.c index b3c7f111..04b972d4 100644 --- a/src/examples/websocket_threaded_example.c +++ b/src/examples/websocket_threaded_example.c | |||
@@ -763,7 +763,7 @@ run_usock (void *cls) | |||
763 | 763 | ||
764 | 764 | ||
765 | static void | 765 | static void |
766 | uh_cb (void *cls, struct MHD_Connection *con, void *con_cls, | 766 | uh_cb (void *cls, struct MHD_Connection *con, void *req_cls, |
767 | const char *extra_in, size_t extra_in_size, MHD_socket sock, | 767 | const char *extra_in, size_t extra_in_size, MHD_socket sock, |
768 | struct MHD_UpgradeResponseHandle *urh) | 768 | struct MHD_UpgradeResponseHandle *urh) |
769 | { | 769 | { |
@@ -774,7 +774,7 @@ uh_cb (void *cls, struct MHD_Connection *con, void *con_cls, | |||
774 | 774 | ||
775 | (void) cls; /* Unused. Silent compiler warning. */ | 775 | (void) cls; /* Unused. Silent compiler warning. */ |
776 | (void) con; /* Unused. Silent compiler warning. */ | 776 | (void) con; /* Unused. Silent compiler warning. */ |
777 | (void) con_cls; /* Unused. Silent compiler warning. */ | 777 | (void) req_cls; /* Unused. Silent compiler warning. */ |
778 | (void) extra_in; /* Unused. Silent compiler warning. */ | 778 | (void) extra_in; /* Unused. Silent compiler warning. */ |
779 | (void) extra_in_size; /* Unused. Silent compiler warning. */ | 779 | (void) extra_in_size; /* Unused. Silent compiler warning. */ |
780 | 780 | ||
@@ -814,7 +814,7 @@ uh_cb (void *cls, struct MHD_Connection *con, void *con_cls, | |||
814 | static enum MHD_Result | 814 | static enum MHD_Result |
815 | ahc_cb (void *cls, struct MHD_Connection *con, const char *url, | 815 | ahc_cb (void *cls, struct MHD_Connection *con, const char *url, |
816 | const char *method, const char *version, const char *upload_data, | 816 | const char *method, const char *version, const char *upload_data, |
817 | size_t *upload_data_size, void **ptr) | 817 | size_t *upload_data_size, void **req_cls) |
818 | { | 818 | { |
819 | struct MHD_Response *res; | 819 | struct MHD_Response *res; |
820 | const char *upg_header; | 820 | const char *upg_header; |
@@ -830,12 +830,12 @@ ahc_cb (void *cls, struct MHD_Connection *con, const char *url, | |||
830 | (void) upload_data; /* Unused. Silent compiler warning. */ | 830 | (void) upload_data; /* Unused. Silent compiler warning. */ |
831 | (void) upload_data_size; /* Unused. Silent compiler warning. */ | 831 | (void) upload_data_size; /* Unused. Silent compiler warning. */ |
832 | 832 | ||
833 | if (NULL == *ptr) | 833 | if (NULL == *req_cls) |
834 | { | 834 | { |
835 | *ptr = (void *) 1; | 835 | *req_cls = (void *) 1; |
836 | return MHD_YES; | 836 | return MHD_YES; |
837 | } | 837 | } |
838 | *ptr = NULL; | 838 | *req_cls = NULL; |
839 | upg_header = MHD_lookup_connection_value (con, MHD_HEADER_KIND, | 839 | upg_header = MHD_lookup_connection_value (con, MHD_HEADER_KIND, |
840 | MHD_HTTP_HEADER_UPGRADE); | 840 | MHD_HTTP_HEADER_UPGRADE); |
841 | con_header = MHD_lookup_connection_value (con, MHD_HEADER_KIND, | 841 | con_header = MHD_lookup_connection_value (con, MHD_HEADER_KIND, |