aboutsummaryrefslogtreecommitdiff
path: root/doc/examples/responseheaders.c
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/responseheaders.c')
-rw-r--r--doc/examples/responseheaders.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/doc/examples/responseheaders.c b/doc/examples/responseheaders.c
index 30ac4596..cddcaa66 100644
--- a/doc/examples/responseheaders.c
+++ b/doc/examples/responseheaders.c
@@ -63,9 +63,21 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
63 return MHD_NO; 63 return MHD_NO;
64 } 64 }
65 response = 65 response =
66 MHD_create_response_from_fd_at_offset64 ((size_t) sbuf.st_size, fd, 0); 66 MHD_create_response_from_fd_at_offset64 ((size_t) sbuf.st_size,
67 MHD_add_response_header (response, "Content-Type", MIMETYPE); 67 fd,
68 ret = MHD_queue_response (connection, MHD_HTTP_OK, response); 68 0);
69 if (MHD_YES !=
70 MHD_add_response_header (response,
71 MHD_HTTP_HEADER_CONTENT_TYPE,
72 MIMETYPE))
73 {
74 fprintf (stderr,
75 "Failed to set content encoding type!\n");
76 /* return response without content encoding anyway ... */
77 }
78 ret = MHD_queue_response (connection,
79 MHD_HTTP_OK,
80 response);
69 MHD_destroy_response (response); 81 MHD_destroy_response (response);
70 82
71 return ret; 83 return ret;