aboutsummaryrefslogtreecommitdiff
path: root/doc/examples/responseheaders.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-01-04 12:40:03 +0000
committerChristian Grothoff <christian@grothoff.org>2011-01-04 12:40:03 +0000
commit43542a78c6bfc10dc06196c0702b802eb6a45591 (patch)
tree3857b4ec8cd7ce3c8cbba77de74902cdd6b92c10 /doc/examples/responseheaders.c
parent3af8f4ce646d29cd5942a1e3dda3b7ed03a82af6 (diff)
downloadlibmicrohttpd-43542a78c6bfc10dc06196c0702b802eb6a45591.tar.gz
libmicrohttpd-43542a78c6bfc10dc06196c0702b802eb6a45591.zip
introducing MHD_create_response_from_buffer, deprecating MHD_create_response_from_data
Diffstat (limited to 'doc/examples/responseheaders.c')
-rw-r--r--doc/examples/responseheaders.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/examples/responseheaders.c b/doc/examples/responseheaders.c
index c45f7c24..a78db1b9 100644
--- a/doc/examples/responseheaders.c
+++ b/doc/examples/responseheaders.c
@@ -31,9 +31,9 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
31 "<html><body>An internal server error has occured!\ 31 "<html><body>An internal server error has occured!\
32 </body></html>"; 32 </body></html>";
33 response = 33 response =
34 MHD_create_response_from_data (strlen (errorstr), 34 MHD_create_response_from_buffer (strlen (errorstr),
35 (void *) errorstr, 35 (void *) errorstr,
36 MHD_NO, MHD_NO); 36 MHD_RESPMEM_PERSISTENT);
37 if (response) 37 if (response)
38 { 38 {
39 ret = 39 ret =
@@ -47,7 +47,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
47 return MHD_NO; 47 return MHD_NO;
48 } 48 }
49 response = 49 response =
50 MHD_create_response_from_fd (fd, sbuf.st_size); 50 MHD_create_response_from_fd_at_offset (fd, sbuf.st_size, 0);
51 MHD_add_response_header (response, "Content-Type", MIMETYPE); 51 MHD_add_response_header (response, "Content-Type", MIMETYPE);
52 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 52 ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
53 MHD_destroy_response (response); 53 MHD_destroy_response (response);