GNU libmicrohttpd
0.9.29
|
internal and public structures – most of the structs used by the library are defined here More...
Go to the source code of this file.
Data Structures | |
struct | SPDYF_Response_Queue |
struct | SPDY_NameValue |
struct | SPDYF_Stream |
struct | SPDY_Session |
struct | SPDY_Daemon |
struct | SPDY_Response |
Macros | |
#define | DLL_insert(head, tail, element) |
#define | DLL_remove(head, tail, element) |
#define | SPDYF_CONTROL_FRAME_HTON(frame) |
#define | SPDYF_CONTROL_FRAME_NTOH(frame) |
#define | SPDYF_DATA_FRAME_HTON(frame) |
#define | SPDYF_DATA_FRAME_NTOH(frame) |
Typedefs | |
typedef int(* | SPDYF_NewDataCallback )(void *cls, struct SPDYF_Stream *stream, const void *buf, size_t size, bool more) |
typedef int(* | SPDYF_NewStreamCallback )(void *cls, struct SPDYF_Stream *stream) |
typedef void(* | SPDYF_ResponseQueueResultCallback )(void *cls, struct SPDYF_Response_Queue *response_queue, enum SPDY_RESPONSE_RESULT status) |
Functions | |
struct | __attribute__ ((__packed__)) SPDYF_Control_Frame |
struct SPDYF_Response_Queue * | SPDYF_response_queue_create (bool is_data, void *data, size_t data_size, struct SPDY_Response *response, struct SPDYF_Stream *stream, bool closestream, SPDYF_ResponseQueueResultCallback frqcb, void *frqcb_cls, SPDY_ResponseResultCallback rrcb, void *rrcb_cls) |
void | SPDYF_response_queue_destroy (struct SPDYF_Response_Queue *response_queue) |
int | SPDYF_name_value_is_empty (struct SPDY_NameValue *container) |
int | SPDYF_name_value_from_stream (void *stream, size_t size, struct SPDY_NameValue **container) |
ssize_t | SPDYF_name_value_to_stream (struct SPDY_NameValue *container[], int num_containers, void **stream) |
internal and public structures – most of the structs used by the library are defined here
Definition in file structures.h.
#define DLL_insert | ( | head, | |
tail, | |||
element | |||
) |
Insert an element at the head of a DLL. Assumes that head, tail and element are structs with prev and next fields.
head | pointer to the head of the DLL (struct ? *) |
tail | pointer to the tail of the DLL (struct ? *) |
element | element to insert (struct ? *) |
Definition at line 1059 of file structures.h.
#define DLL_remove | ( | head, | |
tail, | |||
element | |||
) |
Remove an element from a DLL. Assumes that head, tail and element are structs with prev and next fields.
head | pointer to the head of the DLL (struct ? *) |
tail | pointer to the tail of the DLL (struct ? *) |
element | element to remove (struct ? *) |
Definition at line 1078 of file structures.h.
#define SPDYF_CONTROL_FRAME_HTON | ( | frame | ) |
Convert all integers in a SPDY control frame headers structure from host byte order to network byte order.
frame | input and output structure (struct SPDY_Control_Frame *) |
Definition at line 1100 of file structures.h.
Referenced by SPDYF_handler_write_goaway(), SPDYF_handler_write_rst_stream(), SPDYF_handler_write_syn_reply(), and SPDYF_handler_write_window_update().
#define SPDYF_CONTROL_FRAME_NTOH | ( | frame | ) |
Convert all integers in a SPDY control frame headers structure from network byte order to host byte order.
frame | input and output structure (struct SPDY_Control_Frame *) |
Definition at line 1117 of file structures.h.
Referenced by SPDYF_session_idle().
#define SPDYF_DATA_FRAME_HTON | ( | frame | ) |
Convert all integers in a SPDY data frame headers structure from host byte order to network byte order.
frame | input and output structure (struct SPDY_Data_Frame *) |
Definition at line 1134 of file structures.h.
Referenced by SPDYF_handler_write_data().
#define SPDYF_DATA_FRAME_NTOH | ( | frame | ) |
Convert all integers in a SPDY data frame headers structure from network byte order to host byte order.
frame | input and output structure (struct SPDY_Data_Frame *) |
Definition at line 1150 of file structures.h.
Referenced by SPDYF_session_idle().
typedef int(* SPDYF_NewDataCallback)(void *cls, struct SPDYF_Stream *stream, const void *buf, size_t size, bool more) |
Callback for received new data chunk.
cls | client-defined closure |
stream | handler |
buf | data chunk from the data |
size | the size of the data chunk 'buf' in bytes |
more | false if this is the last frame received on this stream. Note: true does not mean that more data will come, exceptional situation is possible |
Definition at line 335 of file structures.h.
typedef int(* SPDYF_NewStreamCallback)(void *cls, struct SPDYF_Stream *stream) |
Callback for new stream. To be used in the application layer of the lib.
cls | |
stream | the new stream |
Definition at line 352 of file structures.h.
typedef void(* SPDYF_ResponseQueueResultCallback)(void *cls, struct SPDYF_Response_Queue *response_queue, enum SPDY_RESPONSE_RESULT status) |
Callback to be called when the response queue object was handled and the data was already sent.
cls | |
response_queue | the SPDYF_Response_Queue structure which will be cleaned very soon |
status | shows if actually the response was sent or it was discarded by the lib for any reason (e.g., closing session, closing stream, stopping daemon, etc.). It is possible that status indicates an error but part of the response (in one or several frames) was sent to the client. |
Definition at line 370 of file structures.h.
All possible SPDY control frame types. The number is used in the header of the control frame.
Definition at line 38 of file structures.h.
enum SPDY_DATA_FLAG |
Specific flags for the data frame.
Definition at line 201 of file structures.h.
enum SPDY_GOAWAY_STATUS |
Status code within GOAWAY control frame.
Definition at line 295 of file structures.h.
Status code within RST_STREAM control frame.
Definition at line 219 of file structures.h.
enum SPDY_SESSION_STATUS |
SPDY_SESSION_STATUS is used to show the current receiving state of each session, i.e. what is expected to come now, and how it should be handled.
Definition at line 129 of file structures.h.
enum SPDY_SYN_REPLY_FLAG |
Specific flags for the SYN_REPLY control frame.
Enumerator | |
---|---|
SPDY_SYN_REPLY_FLAG_FIN |
The sender won't send any more frames on this stream. |
Definition at line 189 of file structures.h.
enum SPDY_SYN_STREAM_FLAG |
Specific flags for the SYN_STREAM control frame.
Enumerator | |
---|---|
SPDY_SYN_STREAM_FLAG_FIN |
The sender won't send any more frames on this stream. |
SPDY_SYN_STREAM_FLAG_UNIDIRECTIONAL |
The sender creates this stream as unidirectional. |
Definition at line 172 of file structures.h.
|
read |
Representation of the control frame's headers, which are common for all types.
Representation of the data frame's headers.
Definition at line 379 of file structures.h.
int SPDYF_name_value_from_stream | ( | void * | stream, |
size_t | size, | ||
struct SPDY_NameValue ** | container | ||
) |
Transforms raw binary decomressed stream of headers into SPDY_NameValue, containing all of the headers and values.
stream | that is to be transformed |
size | length of the stream |
container | will contain the newly created SPDY_NameValue container. Should point to NULL. |
Definition at line 539 of file structures.c.
References SPDY_NameValue::name, NULL, SPDY_INPUT_ERROR, SPDY_name_value_add(), SPDY_name_value_create(), SPDY_name_value_destroy(), SPDY_NO, SPDY_YES, and SPDY_NameValue::value.
Referenced by spdyf_handler_read_syn_stream().
int SPDYF_name_value_is_empty | ( | struct SPDY_NameValue * | container | ) |
Checks if the container is empty, i.e. created but no values were added to it.
container |
Definition at line 35 of file structures.c.
References SPDY_NameValue::name, NULL, SPDY_NO, SPDY_YES, SPDYF_ASSERT, and SPDY_NameValue::value.
Referenced by SPDY_build_response(), SPDY_name_value_add(), SPDY_name_value_iterate(), and SPDY_name_value_lookup().
ssize_t SPDYF_name_value_to_stream | ( | struct SPDY_NameValue * | container[], |
int | num_containers, | ||
void ** | stream | ||
) |
Transforms array of objects of name/values tuples, containing HTTP headers, into raw binary stream. The resulting stream is ready to be compressed and sent.
container | one or more SPDY_NameValue objects. Each object contains multiple number of name/value tuples. |
num_containers | length of the array |
stream | will contain the resulting stream. Should point to NULL. |
Definition at line 449 of file structures.c.
References SPDY_NameValue::name, SPDY_NameValue::next, NULL, SPDY_NameValue::num_values, SPDYF_ASSERT, and SPDY_NameValue::value.
Referenced by SPDY_build_response().
|
read |
Creates one or more new SPDYF_Response_Queue object to be put on the response queue.
is_data | whether new data frame or new control frame will be crerated |
data | the row stream which will be used as the body of the frame |
data_size | length of data |
response | object, part of which is the frame |
stream | on which data is to be sent |
closestream | TRUE if the frame must close the stream (with flag) |
frqcb | callback to notify application layer when the frame has been sent or discarded |
frqcb_cls | closure for frqcb |
rrcb | callback used by the application layer to notify the application when the frame has been sent or discarded. frqcb will call it |
rrcb_cls | closure for rrcb |
Definition at line 284 of file structures.c.
References SPDYF_Response_Queue::control_frame, SPDYF_Response_Queue::data, SPDYF_Response_Queue::data_frame, SPDYF_Response_Queue::data_size, SPDYF_Response_Queue::frqcb, SPDYF_Response_Queue::frqcb_cls, SPDYF_Response_Queue::is_data, SPDYF_Response_Queue::next, NULL, SPDYF_Response_Queue::prev, SPDYF_Response_Queue::process_response_handler, SPDY_Response::rcb, SPDYF_Response_Queue::response, SPDYF_Response_Queue::rrcb, SPDYF_Response_Queue::rrcb_cls, SPDY_CONTROL_FRAME_TYPES_SYN_REPLY, SPDY_DATA_FLAG_FIN, SPDY_MAX_SUPPORTED_FRAME_SIZE, SPDY_SYN_REPLY_FLAG_FIN, SPDY_VERSION, SPDYF_ASSERT, SPDYF_handler_write_data(), SPDYF_handler_write_syn_reply(), SPDYF_Response_Queue::stream, and SPDYF_Stream::stream_id.
Referenced by SPDY_queue_response(), and SPDYF_handler_write_data().
void SPDYF_response_queue_destroy | ( | struct SPDYF_Response_Queue * | response_queue | ) |
Destroys SPDYF_Response_Queue structure and whatever is in it.
response_queue | to destroy |
Definition at line 429 of file structures.c.
References SPDYF_Response_Queue::control_frame, SPDYF_Response_Queue::data, SPDYF_Response_Queue::data_frame, SPDYF_Response_Queue::is_data, SPDY_CONTROL_FRAME_TYPES_GOAWAY, and SPDY_CONTROL_FRAME_TYPES_RST_STREAM.
Referenced by SPDY_queue_response(), SPDYF_session_destroy(), and SPDYF_session_write().