GNU libmicrohttpd 0.9.77
|
implementation of MHD_response_from_fd() More...
#include "internal.h"
Go to the source code of this file.
Macros | |
#define | MHD_FILE_READ_BLOCK_SIZE 4096 /* 4k */ |
Functions | |
static ssize_t | file_reader (void *cls, uint64_t pos, char *buf, size_t max) |
static void | free_callback (void *cls) |
struct MHD_Response * | MHD_response_from_fd (enum MHD_HTTP_StatusCode sc, int fd, uint64_t offset, uint64_t size) |
implementation of MHD_response_from_fd()
Definition in file response_from_fd.c.
#define MHD_FILE_READ_BLOCK_SIZE 4096 /* 4k */ |
Size of single file read operation for file-backed responses.
Definition at line 39 of file response_from_fd.c.
|
static |
Given a file descriptor, read data from the file to generate the response.
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 |
Definition at line 54 of file response_from_fd.c.
References MHD_Response::fd, MHD_Response::fd_off, INT32_MAX, MHD_CONTENT_READER_END_OF_STREAM, MHD_CONTENT_READER_END_WITH_ERROR, and SSIZE_MAX.
Referenced by MHD_response_from_fd().
|
static |
Destroy file reader context. Closes the file descriptor.
cls | pointer to file descriptor |
Definition at line 148 of file response_from_fd.c.
References MHD_Response::fd.
Referenced by MHD_response_from_fd().