diff options
Diffstat (limited to 'doc/examples/websocket.c')
-rw-r--r-- | doc/examples/websocket.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/doc/examples/websocket.c b/doc/examples/websocket.c index 77bc55cd..018d4c5a 100644 --- a/doc/examples/websocket.c +++ b/doc/examples/websocket.c | |||
@@ -330,10 +330,9 @@ access_handler (void *cls, | |||
330 | if (0 == strcmp (url, "/")) | 330 | if (0 == strcmp (url, "/")) |
331 | { | 331 | { |
332 | /* Default page for visiting the server */ | 332 | /* Default page for visiting the server */ |
333 | struct MHD_Response *response = MHD_create_response_from_buffer ( | 333 | struct MHD_Response *response; |
334 | strlen (PAGE), | 334 | response = MHD_create_response_from_buffer_static (strlen (PAGE), |
335 | PAGE, | 335 | PAGE); |
336 | MHD_RESPMEM_PERSISTENT); | ||
337 | ret = MHD_queue_response (connection, | 336 | ret = MHD_queue_response (connection, |
338 | MHD_HTTP_OK, | 337 | MHD_HTTP_OK, |
339 | response); | 338 | response); |
@@ -400,10 +399,11 @@ access_handler (void *cls, | |||
400 | else | 399 | else |
401 | { | 400 | { |
402 | /* return error page */ | 401 | /* return error page */ |
403 | struct MHD_Response *response = MHD_create_response_from_buffer ( | 402 | struct MHD_Response *response; |
404 | strlen (PAGE_INVALID_WEBSOCKET_REQUEST), | 403 | response = |
405 | PAGE_INVALID_WEBSOCKET_REQUEST, | 404 | MHD_create_response_from_buffer_static (strlen ( |
406 | MHD_RESPMEM_PERSISTENT); | 405 | PAGE_INVALID_WEBSOCKET_REQUEST), |
406 | PAGE_INVALID_WEBSOCKET_REQUEST); | ||
407 | ret = MHD_queue_response (connection, | 407 | ret = MHD_queue_response (connection, |
408 | MHD_HTTP_BAD_REQUEST, | 408 | MHD_HTTP_BAD_REQUEST, |
409 | response); | 409 | response); |
@@ -412,10 +412,11 @@ access_handler (void *cls, | |||
412 | } | 412 | } |
413 | else | 413 | else |
414 | { | 414 | { |
415 | struct MHD_Response *response = MHD_create_response_from_buffer ( | 415 | struct MHD_Response *response; |
416 | strlen (PAGE_NOT_FOUND), | 416 | response = |
417 | PAGE_NOT_FOUND, | 417 | MHD_create_response_from_buffer_static (strlen ( |
418 | MHD_RESPMEM_PERSISTENT); | 418 | PAGE_NOT_FOUND), |
419 | PAGE_NOT_FOUND); | ||
419 | ret = MHD_queue_response (connection, | 420 | ret = MHD_queue_response (connection, |
420 | MHD_HTTP_NOT_FOUND, | 421 | MHD_HTTP_NOT_FOUND, |
421 | response); | 422 | response); |