diff options
Diffstat (limited to 'doc/chapters/basicauthentication.inc')
-rw-r--r-- | doc/chapters/basicauthentication.inc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/doc/chapters/basicauthentication.inc b/doc/chapters/basicauthentication.inc index ca48403a..7aa33637 100644 --- a/doc/chapters/basicauthentication.inc +++ b/doc/chapters/basicauthentication.inc | |||
@@ -64,10 +64,10 @@ application should suspend the connection). | |||
64 | @end enumerate | 64 | @end enumerate |
65 | 65 | ||
66 | But how can we tell whether the callback has been called before for the | 66 | But how can we tell whether the callback has been called before for the |
67 | particular connection? Initially, the pointer this parameter references is | 67 | particular request? Initially, the pointer this parameter references is |
68 | set by @emph{MHD} in the callback. But it will also be "remembered" on the | 68 | set by @emph{MHD} in the callback. But it will also be "remembered" on the |
69 | next call (for the same connection). Thus, we can use the @code{con_cls} | 69 | next call (for the same request). Thus, we can use the @code{req_cls} |
70 | location to keep track of the connection state. For now, we will simply | 70 | location to keep track of the request state. For now, we will simply |
71 | generate no response until the parameter is non-null---implying the callback | 71 | generate no response until the parameter is non-null---implying the callback |
72 | was called before at least once. We do not need to share information between | 72 | was called before at least once. We do not need to share information between |
73 | different calls of the callback, so we can set the parameter to any address | 73 | different calls of the callback, so we can set the parameter to any address |
@@ -81,10 +81,10 @@ static int | |||
81 | answer_to_connection (void *cls, struct MHD_Connection *connection, | 81 | answer_to_connection (void *cls, struct MHD_Connection *connection, |
82 | const char *url, const char *method, const char *version, | 82 | const char *url, const char *method, const char *version, |
83 | const char *upload_data, size_t *upload_data_size, | 83 | const char *upload_data, size_t *upload_data_size, |
84 | void **con_cls) | 84 | void **req_cls) |
85 | { | 85 | { |
86 | if (0 != strcmp(method, "GET")) return MHD_NO; | 86 | if (0 != strcmp(method, "GET")) return MHD_NO; |
87 | if (NULL == *con_cls) {*con_cls = connection; return MHD_YES;} | 87 | if (NULL == *req_cls) {*req_cls = connection; return MHD_YES;} |
88 | 88 | ||
89 | ... | 89 | ... |
90 | /* else respond accordingly */ | 90 | /* else respond accordingly */ |
@@ -116,7 +116,7 @@ static int | |||
116 | answer_to_connection (void *cls, struct MHD_Connection *connection, | 116 | answer_to_connection (void *cls, struct MHD_Connection *connection, |
117 | const char *url, const char *method, | 117 | const char *url, const char *method, |
118 | const char *version, const char *upload_data, | 118 | const char *version, const char *upload_data, |
119 | size_t *upload_data_size, void **con_cls) | 119 | size_t *upload_data_size, void **req_cls) |
120 | { | 120 | { |
121 | char *user; | 121 | char *user; |
122 | char *pass; | 122 | char *pass; |
@@ -126,9 +126,9 @@ answer_to_connection (void *cls, struct MHD_Connection *connection, | |||
126 | 126 | ||
127 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) | 127 | if (0 != strcmp (method, MHD_HTTP_METHOD_GET)) |
128 | return MHD_NO; | 128 | return MHD_NO; |
129 | if (NULL == *con_cls) | 129 | if (NULL == *req_cls) |
130 | { | 130 | { |
131 | *con_cls = connection; | 131 | *req_cls = connection; |
132 | return MHD_YES; | 132 | return MHD_YES; |
133 | } | 133 | } |
134 | pass = NULL; | 134 | pass = NULL; |