/* * Copyright 2001-2007 Niels Provos <provos@citi.umich.edu> * Copyright 2007-2012 Niels Provos and Nick Mathewson * * This header file contains definitions for dealing with HTTP requests * that are internal to libevent. As user of the library, you should not * need to know about these.
*/
/* Indicates an unknown request method. */ #define EVHTTP_REQ_UNKNOWN_ (1<<15)
enum evhttp_connection_state {
EVCON_DISCONNECTED, /**< not currently connected not trying either*/
EVCON_CONNECTING, /**< tries to currently connect */
EVCON_IDLE, /**< connection is established */
EVCON_READING_FIRSTLINE,/**< reading Request-Line (incoming conn) or
**< Status-Line (outgoing conn) */
EVCON_READING_HEADERS, /**< reading request/response headers */
EVCON_READING_BODY, /**< reading request/response body */
EVCON_READING_TRAILER, /**< reading request/response chunked trailer */
EVCON_WRITING /**< writing request/response headers/body */
};
struct event_base;
/* A client or server connection. */ struct evhttp_connection { /* we use this tailq only if this connection was created for an http
* server */
TAILQ_ENTRY(evhttp_connection) next;
evutil_socket_t fd; struct bufferevent *bufev;
struct event retry_ev; /* for retrying connects */
char *bind_address; /* address to use for binding the src */
ev_uint16_t bind_port; /* local port for binding the src */
char *address; /* address to connect to */
ev_uint16_t port;
int flags; #define EVHTTP_CON_INCOMING 0x0001 /* only one request on it ever */ #define EVHTTP_CON_OUTGOING 0x0002 /* multiple requests possible */ #define EVHTTP_CON_CLOSEDETECT 0x0004 /* detecting if persistent close */ /* set when we want to auto free the connection */ #define EVHTTP_CON_AUTOFREE EVHTTP_CON_PUBLIC_FLAGS_END /* Installed when attempt to read HTTP error after write failed, see
* EVHTTP_CON_READ_ON_WRITE_ERROR */ #define EVHTTP_CON_READING_ERROR (EVHTTP_CON_AUTOFREE << 1)
struct timeval timeout; /* timeout for events */ int retry_cnt; /* retry count */ int retry_max; /* maximum number of retries */ struct timeval initial_retry_timeout; /* Timeout for low long to wait * after first failing attempt
* before retry */
enum evhttp_connection_state state;
/* for server connections, the http server they are connected with */ struct evhttp *http_server;
/* response sending HTML the data in the buffer */ void evhttp_response_code_(struct evhttp_request *, int, constchar *); void evhttp_send_page_(struct evhttp_request *, struct evbuffer *);
EVENT2_EXPORT_SYMBOL int evhttp_decode_uri_internal(constchar *uri, size_t length, char *ret, int decode_plus);
#endif/* HTTP_INTERNAL_H_INCLUDED_ */
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.