diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-01-18 15:17:21 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2022-01-18 15:18:40 +0300 |
commit | bd41946e8f4f2086f7b2fcacc468a668c0676aff (patch) | |
tree | 151e103d07dc210f8365bbef0c26361d29873850 /src/examples/querystring_example.c | |
parent | 17c22c2c3b8e2b56874ff701be58e7c10d1d41f4 (diff) | |
download | libmicrohttpd-bd41946e8f4f2086f7b2fcacc468a668c0676aff.tar.gz libmicrohttpd-bd41946e8f4f2086f7b2fcacc468a668c0676aff.zip |
Renamed 'con_cls' -> 'req_cls' for access handler callback
The argument is actually request-specific, not connection specific. The
name was confusing.
Fixed related documentation and clarified usage.
Also fixed code where argument named 'unused' was actually used.
Diffstat (limited to 'src/examples/querystring_example.c')
-rw-r--r-- | src/examples/querystring_example.c | 8 |
1 files changed, 4 insertions, 4 deletions
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"); |