aboutsummaryrefslogtreecommitdiff
path: root/src/examples/refuse_post_example.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/examples/refuse_post_example.c')
-rw-r--r--src/examples/refuse_post_example.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/examples/refuse_post_example.c b/src/examples/refuse_post_example.c
index 5445160b..0c389bb0 100644
--- a/src/examples/refuse_post_example.c
+++ b/src/examples/refuse_post_example.c
@@ -56,9 +56,9 @@ ahc_echo (void *cls,
56 /* always to busy for POST requests */ 56 /* always to busy for POST requests */
57 if (0 == strcmp (method, "POST")) 57 if (0 == strcmp (method, "POST"))
58 { 58 {
59 response = MHD_create_response_from_data (strlen (BUSYPAGE), 59 response = MHD_create_response_from_buffer (strlen (BUSYPAGE),
60 (void *) BUSYPAGE, MHD_NO, 60 (void *) BUSYPAGE,
61 MHD_NO); 61 MHD_RESPMEM_PERSISTENT);
62 ret = 62 ret =
63 MHD_queue_response (connection, MHD_HTTP_SERVICE_UNAVAILABLE, 63 MHD_queue_response (connection, MHD_HTTP_SERVICE_UNAVAILABLE,
64 response); 64 response);
@@ -68,8 +68,9 @@ ahc_echo (void *cls,
68 } 68 }
69 69
70 *ptr = NULL; /* reset when done */ 70 *ptr = NULL; /* reset when done */
71 response = MHD_create_response_from_data (strlen (me), 71 response = MHD_create_response_from_buffer (strlen (me),
72 (void *) me, MHD_NO, MHD_NO); 72 (void *) me,
73 MHD_RESPMEM_PERSISTENT);
73 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 74 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
74 MHD_destroy_response (response); 75 MHD_destroy_response (response);
75 return ret; 76 return ret;