Lines Matching +full:- +full:a

1 /* Copyright (c) 2013-2018 the Civetweb developers
2 * Copyright (c) 2004-2013 Sergey Lyubka
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
97 /* Support on-the-fly compression. */
124 /* Un-initialize this library.
147 const char *request_uri; /* URL-decoded URI (absolute or relative,
149 const char *local_uri; /* URL-decoded URI (relative). Can be NULL
150 * if the request_uri does not address a
152 #if defined(MG_LEGACY_INTERFACE) /* 2017-02-04, deprecated 2014-09-14 */
160 char remote_addr[48]; /* Client's IP address as a string. */
163 can be -1 if no length was given. */
165 int is_ssl; /* 1 if SSL-ed, 0 if not */
167 void *conn_data; /* Connection-specific user data */
188 can be -1 if no length was given. */
206 #if defined(MG_LEGACY_INTERFACE) /* 2017-10-05 */
218 which callbacks to invoke. For a detailed description, see
223 by sending valid HTTP headers and a body. Civetweb will not do
227 required, use a request_handler instead.
231 1-999: callback already processed the request. Civetweb will
233 return code is stored as a HTTP status code for the
240 /* Called when civetweb is about to log a message. If callback returns
241 non-zero, civetweb does not log anything. */
245 non-zero, civetweb does not log anything. */
254 -1: initializing ssl fails. */
257 /* Called when civetweb is about to create or free a SSL_CTX.
268 -1: initializing ssl fails.*/
271 #if defined(MG_LEGACY_INTERFACE) /* 2015-08-19 */
299 /* Called when civetweb is closing a connection. The per-context mutex is
304 for noting when a websocket is closing, and used to remove it from any
305 application-maintained list of clients.
311 (mg_request_info->conn_data, mg_get_user_connection_data),
323 #if defined(MG_LEGACY_INTERFACE) /* 2016-05-14 */
324 /* Called when civetweb has uploaded a file to a temporary directory as a
356 /* Called when a new worker thread is initialized.
361 * 1 indicates a worker thread handling client connections
364 * This function returns a user supplied pointer. The pointer is assigned
366 * mg_get_thread_pointer in all server callbacks. Note: A connection and
367 * a thread are not directly related. Threads will serve several different
368 * connections, and data from a single connection may call different
370 * in a callback handler, but should not be stored beyond the scope of
375 /* Called when a worker exits.
385 /* Called when initializing a new connection object.
387 * (mg_request_info->conn_data, mg_get_user_connection_data).
388 * When the callback is called, it is not yet known if a
405 callbacks: mg_callbacks structure with user-defined callbacks.
409 Side-effects: on UNIX, ignores SIGCHLD and SIGPIPE signals. If custom
444 * ctx: Context handle of a server started by mg_start.
450 * -1 for a parameter error
451 * -2 invalid options
452 * -3 initializing SSL failed
453 * -4 mandatory domain option missing
454 * -5 duplicate domain
455 * -6 out of memory
456 * > 0 index / handle of a new domain
465 Called when a new request comes in. This callback is URI based
473 1 - 999: the handler processed the request. The return code is
474 stored as a HTTP status code for the access log. */
480 Sets or removes a URI mapping for a request handler.
484 consider two URIs: /a/b and /a
485 /a matches /a
486 /a/b matches /a/b
487 /a/c matches /a
495 The URI used to remove a handler must match exactly the
496 one used to register it (not only a pattern match).
507 Is called when the client intends to establish a websocket connection,
518 Is called when a data frame has been received from the client.
552 This function works similar to mg_set_request_handler - see there. */
565 This function works similar to mg_set_request_handler - see there. */
594 Sets or removes a URI mapping for an authorization handler.
595 This function works similar to mg_set_request_handler - see there. */
603 The value returned is read-only. Civetweb does not allow changing
606 names, return value is guaranteed to be non-NULL. If parameter is not
607 set, zero-length string is returned. */
628 reccomended to supply a pointer to some user defined data structure
643 /* Get a formatted link corresponding to the current request
656 #if defined(MG_LEGACY_INTERFACE) /* 2014-02-21 */
673 #if defined(MG_LEGACY_INTERFACE) /* 2017-10-05 */
703 The array is terminated by a NULL name option. */
732 #if defined(MG_LEGACY_INTERFACE) /* 2017-04-02 */
746 * cookie-based way please refer to the examples/chat in the source tree.
749 * passwords_file_name: Path and name of a file storing multiple passwords
766 * Use this function to implement a server and get data about a request
767 * from a HTTP/HTTPS client.
769 * a response from a server, when implementing a client, although the
777 /* Return information associated with a HTTP/HTTPS response.
778 * Use this function in a client, to check the response from
787 -1 on error
792 /* Send data to a websocket client wrapped in a websocket frame. Uses
795 a request simultaneously.
797 Send data to a websocket client wrapped in a websocket frame.
798 This function is available when civetweb is compiled with -DUSE_WEBSOCKET
802 -1 on error
810 /* Send data to a websocket server wrapped in a masked websocket frame. Uses
813 a request simultaneously.
815 Send data to a websocket server wrapped in a masked websocket frame.
816 This function is available when civetweb is compiled with -DUSE_WEBSOCKET
820 -1 on error
830 Invoke this before mg_write or mg_printf when communicating with a
831 websocket if your code has server-initiated communication as well as
832 communication in direct response to a message. */
837 #if defined(MG_LEGACY_INTERFACE) /* 2014-06-21 */
850 #if defined(MG_LEGACY_INTERFACE) /* 2017-10-05 */
871 /* Macros for enabling compiler-specific checks for printf-like arguments. */
898 /* Send a part of the message body, if chunked transfer encoding is set.
899 * Only use this function after sending a complete HTTP request or response
900 * header with "Transfer-Encoding: chunked" set. */
916 * The code must send a valid HTTP response header before using this function.
941 * mime_type: Set Content-Type for the following content.
943 * Will set transfer-encoding to chunked, if set to -1.
953 * The response has content-size zero: do not send any body data after calling
960 * < 0 Error (-1 send error, -2 parameter error)
968 * Browsers will send a user name and password in their next request, showing
982 /* Check if the current request has a valid authentication token set.
983 * A file is used to provide a list of valid user names, realms and
990 * filename: Path and name of a file storing multiple password hashes.
997 * -1 Parameter error
998 * -2 File not found
1010 * mime_type: Content-Type for file. NULL will cause the type to be
1022 mime_type: Content-Type for file. NULL will cause the type to be
1025 Each header should start with an X-, to ensure it is
1035 /* Store body data into a file. */
1038 /* Read entire request body and store it in a file "path".
1055 This is a helper function. It traverses request_info->http_headers array,
1062 /* Get a value of particular form variable.
1065 data: pointer to form-uri-encoded buffer. This could be either POST data,
1075 -1 (variable not found).
1076 -2 (destination buffer is NULL, zero length or too small to hold the
1079 Destination buffer is guaranteed to be '\0' - terminated if it is not
1088 /* Get a value of particular form variable.
1091 data: pointer to form-uri-encoded buffer. This could be either POST data,
1099 this makes it possible to parse a query like
1100 b=x&a=y&a=z which will have occurrence values b:0, a:0 and a:1
1105 -1 (variable not found).
1106 -2 (destination buffer is NULL, zero length or too small to hold the
1109 Destination buffer is guaranteed to be '\0' - terminated if it is not
1121 Destination buffer is guaranteed to be '\0' - terminated. In case of
1128 -1 (either "Cookie:" header is not present at all or the requested
1130 -2 (destination buffer is NULL, zero length or too small to hold the
1167 #if defined(MG_LEGACY_INTERFACE) /* 2016-05-14 */
1168 /* File upload functionality. Each uploaded file gets saved into a temporary
1180 /* This callback function is called, if a new field has been found.
1186 * filename: Name of a file to upload, at the client computer.
1223 * the data will be stored into a file. If the file has been written
1248 #if defined(MG_LEGACY_INTERFACE) /* 2017-10-05 */
1255 /* Store the field value into a file. */
1268 /* Store the field value into a file. */
1290 * error. In this case a number < 0 is returned as well.
1297 /* Convenience function -- create detached thread.
1298 Return: 0 on success, non-0 on error. */
1317 /* URL-decode input buffer into destination buffer.
1318 0-terminate the destination buffer.
1319 form-url-encoded data differs from URI encoding in a way that it
1322 Return: length of the decoded data, or -1 if dst buffer is too small. */
1330 /* URL-encode input buffer into destination buffer.
1331 returns the length of the resulting buffer or -1
1337 Buffer 'buf' must be 33 bytes long. Varargs is a NULL terminated list of
1338 ASCIIz strings. When function returns, buf will contain human-readable
1362 /* Connect to a websocket as a client
1367 use_ssl: make a secure connection to server
1393 /* Connect to a TCP server as a client (can be used to connect to a HTTP server)
1398 use_ssl: make a secure connection to server
1428 enum { TIMEOUT_INFINITE = -1 };
1429 enum { MG_TIMEOUT_INFINITE = -1 };
1431 /* Wait for a response from the server
1435 timeout: time to wait for a response in milliseconds (if < 0 then wait
1450 the library - it does not mean, the feature has been initialized using a
1457 The value is a bit mask. The individual bits are defined as:
1467 The result is undefined, if bits are set that do not represent a
1481 buflen: Length of buffer (including a byte required for a terminating 0).
1483 Available size of system information, exluding a terminating 0.
1485 The result is a JSON formatted string, the exact content may vary.
1498 buflen: Length of buffer (including a byte required for a terminating 0).
1500 Available size of system information, exluding a terminating 0.
1502 The result is a JSON formatted string, the exact content may vary.
1507 context information changes, you should allocate a few bytes more.
1519 buflen: Length of buffer (including a byte required for a terminating 0).
1521 Available size of system information, exluding a terminating 0.
1523 The result is a JSON formatted string, the exact content may vary.
1528 context information changes, you should allocate a few bytes more.