10#if defined(NO_RESPONSE_BUFFERING) && defined(USE_HTTP2)
11#error "HTTP2 works only if NO_RESPONSE_BUFFERING is not set"
19#if !defined(NO_RESPONSE_BUFFERING)
43 const char *status_txt;
47 if ((status_code < 100) || (status_code > 999)) {
58 mg_printf(conn,
"HTTP/%s %i %s\r\n", http_version, status_code, status_txt);
75 if ((conn == NULL) || (status < 100) || (status > 999)) {
93#if !defined(NO_RESPONSE_BUFFERING)
125#if !defined(NO_RESPONSE_BUFFERING)
129 if ((conn == NULL) || (header == NULL) || (
value == NULL)) {
143#if !defined(NO_RESPONSE_BUFFERING)
153 if (value_len >= 0) {
157 memcpy(hbuf,
value, (
unsigned)value_len);
180 if (value_len >= 0) {
210 const char *http1_headers)
214 char *workbuffer, *parse;
229 for (i = 0; i < num_hdr; i++) {
232 if ((ret > 0) && (lret < 0)) {
244#if defined(USE_HTTP2)
245static int http2_send_response_headers(
struct mg_connection *conn);
261#if !defined(NO_RESPONSE_BUFFERING)
264 int has_connection = 0;
284#if !defined(NO_RESPONSE_BUFFERING)
285#if defined(USE_HTTP2)
287 int ret = http2_send_response_headers(conn);
311 time_t curtime = time(NULL);
316 if (!has_connection) {
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
#define mg_malloc_ctx(a, c)
@ CONNECTION_TYPE_REQUEST
int mg_printf(struct mg_connection *conn, const char *fmt,...)
const char * mg_get_response_code_text(const struct mg_connection *conn, int response_code)
static void gmt_time_string(char *buf, size_t buf_len, time_t *t)
int mg_write(struct mg_connection *conn, const void *buf, size_t len)
@ PROTOCOL_TYPE_WEBSOCKET
static const char * suggest_connection_header(const struct mg_connection *conn)
static char * mg_strdup_ctx(const char *str, struct mg_context *ctx)
int mg_strcasecmp(const char *s1, const char *s2)
static __inline void mg_free(void *a)
int mg_response_header_add(struct mg_connection *conn, const char *header, const char *value, int value_len)
int mg_response_header_send(struct mg_connection *conn)
static int parse_http_headers(char **buf, struct mg_header hdr[MG_MAX_HEADERS])
int mg_response_header_add_lines(struct mg_connection *conn, const char *http1_headers)
static void send_http1_response_status_line(struct mg_connection *conn)
static void free_buffered_response_header_list(struct mg_connection *conn)
int mg_response_header_start(struct mg_connection *conn, int status)
struct mg_response_info response_info
struct mg_request_info request_info
struct mg_context * phys_ctx
const char * http_version
struct mg_header http_headers[(64)]