aboutsummaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/basicauthentication.c8
-rw-r--r--doc/examples/hellobrowser.c4
-rw-r--r--doc/examples/largepost.c5
-rw-r--r--doc/examples/responseheaders.c4
-rw-r--r--doc/examples/sessions.c14
-rw-r--r--doc/examples/simplepost.c4
-rw-r--r--doc/examples/tlsauthentication.c4
7 files changed, 12 insertions, 31 deletions
diff --git a/doc/examples/basicauthentication.c b/doc/examples/basicauthentication.c
index 3b105a1d..d75ba636 100644
--- a/doc/examples/basicauthentication.c
+++ b/doc/examples/basicauthentication.c
@@ -54,9 +54,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
54 if (fail) 54 if (fail)
55 { 55 {
56 const char *page = "<html><body>Go away.</body></html>"; 56 const char *page = "<html><body>Go away.</body></html>";
57 response = 57 response = MHD_create_response_from_buffer_static (strlen (page), page);
58 MHD_create_response_from_buffer (strlen (page), (void *) page,
59 MHD_RESPMEM_PERSISTENT);
60 ret = MHD_queue_basic_auth_fail_response (connection, 58 ret = MHD_queue_basic_auth_fail_response (connection,
61 "my realm", 59 "my realm",
62 response); 60 response);
@@ -64,9 +62,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
64 else 62 else
65 { 63 {
66 const char *page = "<html><body>A secret.</body></html>"; 64 const char *page = "<html><body>A secret.</body></html>";
67 response = 65 response = MHD_create_response_from_buffer_static (strlen (page), page);
68 MHD_create_response_from_buffer (strlen (page), (void *) page,
69 MHD_RESPMEM_PERSISTENT);
70 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 66 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
71 } 67 }
72 MHD_destroy_response (response); 68 MHD_destroy_response (response);
diff --git a/doc/examples/hellobrowser.c b/doc/examples/hellobrowser.c
index b14ea6d8..0b7d9071 100644
--- a/doc/examples/hellobrowser.c
+++ b/doc/examples/hellobrowser.c
@@ -31,9 +31,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
31 (void) upload_data_size; /* Unused. Silent compiler warning. */ 31 (void) upload_data_size; /* Unused. Silent compiler warning. */
32 (void) req_cls; /* Unused. Silent compiler warning. */ 32 (void) req_cls; /* Unused. Silent compiler warning. */
33 33
34 response = 34 response = MHD_create_response_from_buffer_static (strlen (page), page);
35 MHD_create_response_from_buffer (strlen (page), (void *) page,
36 MHD_RESPMEM_PERSISTENT);
37 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 35 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
38 MHD_destroy_response (response); 36 MHD_destroy_response (response);
39 37
diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c
index ee9e85da..b7cccc04 100644
--- a/doc/examples/largepost.c
+++ b/doc/examples/largepost.c
@@ -98,10 +98,7 @@ send_page (struct MHD_Connection *connection,
98 enum MHD_Result ret; 98 enum MHD_Result ret;
99 struct MHD_Response *response; 99 struct MHD_Response *response;
100 100
101 response = 101 response = MHD_create_response_from_buffer_static (strlen (page), page);
102 MHD_create_response_from_buffer (strlen (page),
103 (void *) page,
104 MHD_RESPMEM_MUST_COPY);
105 if (! response) 102 if (! response)
106 return MHD_NO; 103 return MHD_NO;
107 MHD_add_response_header (response, 104 MHD_add_response_header (response,
diff --git a/doc/examples/responseheaders.c b/doc/examples/responseheaders.c
index 80eebbe9..162e5e2d 100644
--- a/doc/examples/responseheaders.c
+++ b/doc/examples/responseheaders.c
@@ -49,9 +49,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
49 if (fd != -1) 49 if (fd != -1)
50 (void) close (fd); 50 (void) close (fd);
51 response = 51 response =
52 MHD_create_response_from_buffer (strlen (errorstr), 52 MHD_create_response_from_buffer_static (strlen (errorstr), errorstr);
53 (void *) errorstr,
54 MHD_RESPMEM_PERSISTENT);
55 if (NULL != response) 53 if (NULL != response)
56 { 54 {
57 ret = 55 ret =
diff --git a/doc/examples/sessions.c b/doc/examples/sessions.c
index 5dd74e2c..0fe143eb 100644
--- a/doc/examples/sessions.c
+++ b/doc/examples/sessions.c
@@ -311,9 +311,7 @@ serve_simple_form (const void *cls,
311 struct MHD_Response *response; 311 struct MHD_Response *response;
312 312
313 /* return static form */ 313 /* return static form */
314 response = MHD_create_response_from_buffer (strlen (form), 314 response = MHD_create_response_from_buffer_static (strlen (form), form);
315 (void *) form,
316 MHD_RESPMEM_PERSISTENT);
317 add_session_cookie (session, response); 315 add_session_cookie (session, response);
318 MHD_add_response_header (response, 316 MHD_add_response_header (response,
319 MHD_HTTP_HEADER_CONTENT_ENCODING, 317 MHD_HTTP_HEADER_CONTENT_ENCODING,
@@ -431,9 +429,8 @@ not_found_page (const void *cls,
431 (void) session; /* Unused. Silent compiler warning. */ 429 (void) session; /* Unused. Silent compiler warning. */
432 430
433 /* unsupported HTTP method */ 431 /* unsupported HTTP method */
434 response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR), 432 response = MHD_create_response_from_buffer_static (strlen (NOT_FOUND_ERROR),
435 (void *) NOT_FOUND_ERROR, 433 NOT_FOUND_ERROR);
436 MHD_RESPMEM_PERSISTENT);
437 ret = MHD_queue_response (connection, 434 ret = MHD_queue_response (connection,
438 MHD_HTTP_NOT_FOUND, 435 MHD_HTTP_NOT_FOUND,
439 response); 436 response);
@@ -651,9 +648,8 @@ create_response (void *cls,
651 return ret; 648 return ret;
652 } 649 }
653 /* unsupported HTTP method */ 650 /* unsupported HTTP method */
654 response = MHD_create_response_from_buffer (strlen (METHOD_ERROR), 651 response = MHD_create_response_from_buffer_static (strlen (METHOD_ERROR),
655 (void *) METHOD_ERROR, 652 METHOD_ERROR);
656 MHD_RESPMEM_PERSISTENT);
657 ret = MHD_queue_response (connection, 653 ret = MHD_queue_response (connection,
658 MHD_HTTP_NOT_ACCEPTABLE, 654 MHD_HTTP_NOT_ACCEPTABLE,
659 response); 655 response);
diff --git a/doc/examples/simplepost.c b/doc/examples/simplepost.c
index ea3899d1..51cf23c0 100644
--- a/doc/examples/simplepost.c
+++ b/doc/examples/simplepost.c
@@ -55,9 +55,7 @@ send_page (struct MHD_Connection *connection, const char *page)
55 struct MHD_Response *response; 55 struct MHD_Response *response;
56 56
57 57
58 response = 58 response = MHD_create_response_from_buffer_static (strlen (page), page);
59 MHD_create_response_from_buffer (strlen (page), (void *) page,
60 MHD_RESPMEM_PERSISTENT);
61 if (! response) 59 if (! response)
62 return MHD_NO; 60 return MHD_NO;
63 61
diff --git a/doc/examples/tlsauthentication.c b/doc/examples/tlsauthentication.c
index 4db00b7f..1898e730 100644
--- a/doc/examples/tlsauthentication.c
+++ b/doc/examples/tlsauthentication.c
@@ -208,9 +208,7 @@ secret_page (struct MHD_Connection *connection)
208 struct MHD_Response *response; 208 struct MHD_Response *response;
209 const char *page = "<html><body>A secret.</body></html>"; 209 const char *page = "<html><body>A secret.</body></html>";
210 210
211 response = 211 response = MHD_create_response_from_buffer_static (strlen (page), page);
212 MHD_create_response_from_buffer (strlen (page), (void *) page,
213 MHD_RESPMEM_PERSISTENT);
214 if (! response) 212 if (! response)
215 return MHD_NO; 213 return MHD_NO;
216 214