aboutsummaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/connection_close.c5
-rw-r--r--src/examples/minimal_example_empty.c4
-rw-r--r--src/examples/minimal_example_empty_tls.c4
-rw-r--r--src/examples/websocket_chatserver_example.c22
4 files changed, 14 insertions, 21 deletions
diff --git a/src/examples/connection_close.c b/src/examples/connection_close.c
index e5f787a3..8558eb46 100644
--- a/src/examples/connection_close.c
+++ b/src/examples/connection_close.c
@@ -61,9 +61,8 @@ ahc_echo (void *cls,
61 return MHD_YES; 61 return MHD_YES;
62 } 62 }
63 *req_cls = 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_static (strlen (me),
65 (void *) me, 65 me);
66 MHD_RESPMEM_PERSISTENT);
67 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 66 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
68 MHD_destroy_response (response); 67 MHD_destroy_response (response);
69 return ret; 68 return ret;
diff --git a/src/examples/minimal_example_empty.c b/src/examples/minimal_example_empty.c
index 43719a24..84837f08 100644
--- a/src/examples/minimal_example_empty.c
+++ b/src/examples/minimal_example_empty.c
@@ -55,9 +55,7 @@ ahc_echo (void *cls,
55 return MHD_YES; 55 return MHD_YES;
56 } 56 }
57 *req_cls = NULL; /* reset when done */ 57 *req_cls = NULL; /* reset when done */
58 response = MHD_create_response_from_buffer (0, 58 response = MHD_create_response_empty (MHD_RF_NONE);
59 NULL,
60 MHD_RESPMEM_PERSISTENT);
61 ret = MHD_queue_response (connection, 59 ret = MHD_queue_response (connection,
62 MHD_HTTP_NO_CONTENT, 60 MHD_HTTP_NO_CONTENT,
63 response); 61 response);
diff --git a/src/examples/minimal_example_empty_tls.c b/src/examples/minimal_example_empty_tls.c
index 9c352717..c8c3763f 100644
--- a/src/examples/minimal_example_empty_tls.c
+++ b/src/examples/minimal_example_empty_tls.c
@@ -55,9 +55,7 @@ ahc_echo (void *cls,
55 return MHD_YES; 55 return MHD_YES;
56 } 56 }
57 *req_cls = NULL; /* reset when done */ 57 *req_cls = NULL; /* reset when done */
58 response = MHD_create_response_from_buffer (0, 58 response = MHD_create_response_empty (MHD_RF_NONE);
59 NULL,
60 MHD_RESPMEM_PERSISTENT);
61 ret = MHD_queue_response (connection, 59 ret = MHD_queue_response (connection,
62 MHD_HTTP_NO_CONTENT, 60 MHD_HTTP_NO_CONTENT,
63 response); 61 response);
diff --git a/src/examples/websocket_chatserver_example.c b/src/examples/websocket_chatserver_example.c
index 052b4221..cc3005a2 100644
--- a/src/examples/websocket_chatserver_example.c
+++ b/src/examples/websocket_chatserver_example.c
@@ -2163,10 +2163,9 @@ access_handler (void *cls,
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 */
2166 struct MHD_Response *response = MHD_create_response_from_buffer (strlen ( 2166 struct MHD_Response *response;
2167 PAGE), 2167 response = MHD_create_response_from_buffer_static (strlen (PAGE),
2168 PAGE, 2168 PAGE);
2169 MHD_RESPMEM_PERSISTENT);
2170 ret = MHD_queue_response (connection, 2169 ret = MHD_queue_response (connection,
2171 MHD_HTTP_OK, 2170 MHD_HTTP_OK,
2172 response); 2171 response);
@@ -2259,10 +2258,10 @@ access_handler (void *cls,
2259 else 2258 else
2260 { 2259 {
2261 /* return error page */ 2260 /* return error page */
2262 struct MHD_Response *response = MHD_create_response_from_buffer (strlen ( 2261 struct MHD_Response *response;
2263 PAGE_INVALID_WEBSOCKET_REQUEST), 2262 response = MHD_create_response_from_buffer_static (strlen (
2264 PAGE_INVALID_WEBSOCKET_REQUEST, 2263 PAGE_INVALID_WEBSOCKET_REQUEST),
2265 MHD_RESPMEM_PERSISTENT); 2264 PAGE_INVALID_WEBSOCKET_REQUEST);
2266 ret = MHD_queue_response (connection, 2265 ret = MHD_queue_response (connection,
2267 MHD_HTTP_BAD_REQUEST, 2266 MHD_HTTP_BAD_REQUEST,
2268 response); 2267 response);
@@ -2271,10 +2270,9 @@ access_handler (void *cls,
2271 } 2270 }
2272 else 2271 else
2273 { 2272 {
2274 struct MHD_Response *response = MHD_create_response_from_buffer (strlen ( 2273 struct MHD_Response *response;
2275 PAGE_NOT_FOUND), 2274 response = MHD_create_response_from_buffer_static (strlen (PAGE_NOT_FOUND),
2276 PAGE_NOT_FOUND, 2275 PAGE_NOT_FOUND);
2277 MHD_RESPMEM_PERSISTENT);
2278 ret = MHD_queue_response (connection, 2276 ret = MHD_queue_response (connection,
2279 MHD_HTTP_NOT_FOUND, 2277 MHD_HTTP_NOT_FOUND,
2280 response); 2278 response);