src/microhttpd/response.c File Reference

Methods for managing response objects. More...

#include "internal.h"
#include "response.h"
Include dependency graph for response.c:

Go to the source code of this file.

Functions

static int add_response_entry (struct MHD_Response *response, enum MHD_ValueKind kind, const char *header, const char *content)
int MHD_add_response_header (struct MHD_Response *response, const char *header, const char *content)
int MHD_add_response_footer (struct MHD_Response *response, const char *footer, const char *content)
int MHD_del_response_header (struct MHD_Response *response, const char *header, const char *content)
int MHD_get_response_headers (struct MHD_Response *response, MHD_KeyValueIterator iterator, void *iterator_cls)
const char * MHD_get_response_header (struct MHD_Response *response, const char *key)
struct MHD_ResponseMHD_create_response_from_callback (uint64_t size, size_t block_size, MHD_ContentReaderCallback crc, void *crc_cls, MHD_ContentReaderFreeCallback crfc)
static ssize_t file_reader (void *cls, uint64_t pos, char *buf, size_t max)
static void free_callback (void *cls)
struct MHD_ResponseMHD_create_response_from_fd_at_offset (size_t size, int fd, off_t offset)
struct MHD_ResponseMHD_create_response_from_fd (size_t size, int fd)
struct MHD_ResponseMHD_create_response_from_data (size_t size, void *data, int must_free, int must_copy)
struct MHD_ResponseMHD_create_response_from_buffer (size_t size, void *buffer, enum MHD_ResponseMemoryMode mode)
void MHD_destroy_response (struct MHD_Response *response)
void MHD_increment_response_rc (struct MHD_Response *response)

Detailed Description

Methods for managing response objects.

Author:
Daniel Pittman
Christian Grothoff

Definition in file response.c.


Function Documentation

static int add_response_entry ( struct MHD_Response response,
enum MHD_ValueKind  kind,
const char *  header,
const char *  content 
) [static]

Add a header or footer line to the response.

Parameters:
response response to add a header to
kind header or footer
header the header to add
content value to add
Returns:
MHD_NO on error (i.e. invalid header or content format).

Definition at line 41 of file response.c.

References MHD_Response::first_header, MHD_HTTP_Header::header, MHD_HTTP_Header::kind, MHD_NO, MHD_YES, MHD_HTTP_Header::next, NULL, and MHD_HTTP_Header::value.

Referenced by MHD_add_response_footer(), and MHD_add_response_header().

Here is the caller graph for this function:

static ssize_t file_reader ( void *  cls,
uint64_t  pos,
char *  buf,
size_t  max 
) [static]

Given a file descriptor, read data from the file to generate the response.

Parameters:
cls pointer to the response
pos offset in the file to access
buf where to write the data
max number of bytes to write at most
Returns:
number of bytes written

Definition at line 272 of file response.c.

References MHD_Response::fd, MHD_Response::fd_off, MHD_CONTENT_READER_END_OF_STREAM, and MHD_CONTENT_READER_END_WITH_ERROR.

Referenced by MHD_create_response_from_fd_at_offset().

Here is the caller graph for this function:

static void free_callback ( void *  cls  )  [static]

Destroy file reader context. Closes the file descriptor.

Parameters:
cls pointer to file descriptor

Definition at line 294 of file response.c.

References MHD_Response::fd.

Referenced by MHD_create_response_from_fd_at_offset().

Here is the caller graph for this function:

void MHD_increment_response_rc ( struct MHD_Response response  ) 

Increment response RC. Should this be part of the public API?

Definition at line 473 of file response.c.

References MHD_Response::mutex, and MHD_Response::reference_count.

Referenced by MHD_queue_response().

Here is the caller graph for this function:


Generated on 15 Oct 2014 for GNU libmicrohttpd by  doxygen 1.6.1