GNU libmicrohttpd  0.9.61
response_from_fd.c File Reference

implementation of MHD_response_from_fd() More...

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

Go to the source code of this file.

Functions

static ssize_t file_reader (void *cls, uint64_t pos, char *buf, size_t max)
 
static void free_callback (void *cls)
 
struct MHD_ResponseMHD_response_from_fd (enum MHD_HTTP_StatusCode sc, int fd, uint64_t offset, uint64_t size)
 

Detailed Description

implementation of MHD_response_from_fd()

Author
Daniel Pittman
Christian Grothoff
Karlson2k (Evgeny Grin)

Definition in file response_from_fd.c.

Function Documentation

◆ file_reader()

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
clspointer to the response
posoffset in the file to access
bufwhere to write the data
maxnumber of bytes to write at most
Returns
number of bytes written

Definition at line 41 of file response_from_fd.c.

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

Referenced by MHD_response_from_fd().

Here is the caller graph for this function:

◆ free_callback()

static void free_callback ( void *  cls)
static

Destroy file reader context. Closes the file descriptor.

Parameters
clspointer to file descriptor

Definition at line 135 of file response_from_fd.c.

References MHD_Response::fd.

Referenced by MHD_response_from_fd().

Here is the caller graph for this function: