aboutsummaryrefslogtreecommitdiff
path: root/src/examples/websocket_chatserver_example.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/websocket_chatserver_example.c')
-rw-r--r--src/examples/websocket_chatserver_example.c16
1 files changed, 8 insertions, 8 deletions
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)
2069static void 2069static void
2070upgrade_handler (void *cls, 2070upgrade_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 */
2136static enum MHD_Result 2136static 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 */