003 File Manager
Current Path:
/usr/src/contrib/libevent
usr
/
src
/
contrib
/
libevent
/
📁
..
📄
ChangeLog
(98.8 KB)
📄
ChangeLog-1.4
(16.96 KB)
📄
ChangeLog-2.0
(81.39 KB)
📄
Doxyfile
(9.97 KB)
📄
LICENSE
(4.42 KB)
📄
Makefile.am
(8.64 KB)
📄
Makefile.in
(143.63 KB)
📄
Makefile.nmake
(2.29 KB)
📁
WIN32-Code
📄
aclocal.m4
(41.44 KB)
📄
arc4random.c
(12.83 KB)
📄
autogen.sh
(431 B)
📄
buffer.c
(80.31 KB)
📄
buffer_iocp.c
(8.44 KB)
📄
bufferevent-internal.h
(18.05 KB)
📄
bufferevent.c
(25.49 KB)
📄
bufferevent_async.c
(17.75 KB)
📄
bufferevent_filter.c
(17.58 KB)
📄
bufferevent_openssl.c
(38.57 KB)
📄
bufferevent_pair.c
(9.6 KB)
📄
bufferevent_ratelim.c
(29.51 KB)
📄
bufferevent_sock.c
(18.37 KB)
📄
changelist-internal.h
(4.52 KB)
📁
compat
📄
compile
(7.16 KB)
📄
config.guess
(41.93 KB)
📄
config.h.in
(14.02 KB)
📄
config.sub
(35.14 KB)
📄
configure
(525.2 KB)
📄
configure.ac
(23.97 KB)
📄
defer-internal.h
(2.7 KB)
📄
depcomp
(23.01 KB)
📄
devpoll.c
(7.7 KB)
📄
epoll.c
(14.37 KB)
📄
epoll_sub.c
(2.33 KB)
📄
epolltable-internal.h
(40.4 KB)
📄
evbuffer-internal.h
(12.51 KB)
📄
evconfig-private.h
(1.33 KB)
📄
evconfig-private.h.in
(1.21 KB)
📄
evdns.c
(127.4 KB)
📄
event-internal.h
(16.85 KB)
📄
event.c
(100.49 KB)
📄
event_iocp.c
(7.52 KB)
📄
event_rpcgen.py
(54.33 KB)
📄
event_tagging.c
(14.3 KB)
📄
evmap-internal.h
(4.78 KB)
📄
evmap.c
(28.2 KB)
📄
evport.c
(11.72 KB)
📄
evrpc-internal.h
(5.58 KB)
📄
evrpc.c
(28.68 KB)
📄
evsignal-internal.h
(2.57 KB)
📄
evthread-internal.h
(13.99 KB)
📄
evthread.c
(13.42 KB)
📄
evthread_pthread.c
(4.84 KB)
📄
evthread_win32.c
(8.39 KB)
📄
evutil.c
(69 KB)
📄
evutil_rand.c
(5.08 KB)
📄
evutil_time.c
(16.69 KB)
📄
ht-internal.h
(28.5 KB)
📄
http-internal.h
(5.78 KB)
📄
http.c
(120.9 KB)
📁
include
📄
install-sh
(14.33 KB)
📄
iocp-internal.h
(7.52 KB)
📄
ipv6-internal.h
(2.46 KB)
📄
kqueue-internal.h
(1.94 KB)
📄
kqueue.c
(14.36 KB)
📄
libevent.pc.in
(317 B)
📄
libevent_core.pc.in
(281 B)
📄
libevent_extra.pc.in
(284 B)
📄
libevent_openssl.pc.in
(372 B)
📄
libevent_pthreads.pc.in
(384 B)
📄
listener.c
(20.83 KB)
📄
log-internal.h
(3.14 KB)
📄
log.c
(5.51 KB)
📄
ltmain.sh
(316.49 KB)
📁
m4
📄
make-event-config.sed
(588 B)
📄
minheap-internal.h
(6.78 KB)
📄
missing
(6.71 KB)
📄
mm-internal.h
(3.32 KB)
📄
openssl-compat.h
(974 B)
📄
poll.c
(7.99 KB)
📄
ratelim-internal.h
(4 KB)
📁
sample
📄
select.c
(8.5 KB)
📄
signal.c
(12.22 KB)
📄
strlcpy-internal.h
(366 B)
📄
strlcpy.c
(2.52 KB)
📁
test
📄
test-driver
(4.53 KB)
📄
time-internal.h
(3 KB)
📄
util-internal.h
(15.54 KB)
📄
whatsnew-2.0.txt
(25.73 KB)
📄
whatsnew-2.1.txt
(32.6 KB)
📄
win32select.c
(10.29 KB)
Editing: http-internal.h
/* * 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. */ #ifndef HTTP_INTERNAL_H_INCLUDED_ #define HTTP_INTERNAL_H_INCLUDED_ #include "event2/event_struct.h" #include "util-internal.h" #include "defer-internal.h" #define HTTP_CONNECT_TIMEOUT 45 #define HTTP_WRITE_TIMEOUT 50 #define HTTP_READ_TIMEOUT 50 #define HTTP_PREFIX "http://" #define HTTP_DEFAULTPORT 80 enum message_read_status { ALL_DATA_READ = 1, MORE_DATA_EXPECTED = 0, DATA_CORRUPTED = -1, REQUEST_CANCELED = -2, DATA_TOO_LONG = -3 }; struct evbuffer; struct addrinfo; struct evhttp_request; /* 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; size_t max_headers_size; ev_uint64_t max_body_size; 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; TAILQ_HEAD(evcon_requestq, evhttp_request) requests; void (*cb)(struct evhttp_connection *, void *); void *cb_arg; void (*closecb)(struct evhttp_connection *, void *); void *closecb_arg; struct event_callback read_more_deferred_cb; struct event_base *base; struct evdns_base *dns_base; int ai_family; }; /* A callback for an http server */ struct evhttp_cb { TAILQ_ENTRY(evhttp_cb) next; char *what; void (*cb)(struct evhttp_request *req, void *); void *cbarg; }; /* both the http server as well as the rpc system need to queue connections */ TAILQ_HEAD(evconq, evhttp_connection); /* each bound socket is stored in one of these */ struct evhttp_bound_socket { TAILQ_ENTRY(evhttp_bound_socket) next; struct evconnlistener *listener; }; /* server alias list item. */ struct evhttp_server_alias { TAILQ_ENTRY(evhttp_server_alias) next; char *alias; /* the server alias. */ }; struct evhttp { /* Next vhost, if this is a vhost. */ TAILQ_ENTRY(evhttp) next_vhost; /* All listeners for this host */ TAILQ_HEAD(boundq, evhttp_bound_socket) sockets; TAILQ_HEAD(httpcbq, evhttp_cb) callbacks; /* All live connections on this host. */ struct evconq connections; TAILQ_HEAD(vhostsq, evhttp) virtualhosts; TAILQ_HEAD(aliasq, evhttp_server_alias) aliases; /* NULL if this server is not a vhost */ char *vhost_pattern; struct timeval timeout; size_t default_max_headers_size; ev_uint64_t default_max_body_size; int flags; const char *default_content_type; /* Bitmask of all HTTP methods that we accept and pass to user * callbacks. */ ev_uint16_t allowed_methods; /* Fallback callback if all the other callbacks for this connection don't match. */ void (*gencb)(struct evhttp_request *req, void *); void *gencbarg; struct bufferevent* (*bevcb)(struct event_base *, void *); void *bevcbarg; struct event_base *base; }; /* XXX most of these functions could be static. */ /* resets the connection; can be reused for more requests */ void evhttp_connection_reset_(struct evhttp_connection *); /* connects if necessary */ int evhttp_connection_connect_(struct evhttp_connection *); enum evhttp_request_error; /* notifies the current request that it failed; resets connection */ void evhttp_connection_fail_(struct evhttp_connection *, enum evhttp_request_error error); enum message_read_status; enum message_read_status evhttp_parse_firstline_(struct evhttp_request *, struct evbuffer*); enum message_read_status evhttp_parse_headers_(struct evhttp_request *, struct evbuffer*); void evhttp_start_read_(struct evhttp_connection *); void evhttp_start_write_(struct evhttp_connection *); /* response sending HTML the data in the buffer */ void evhttp_response_code_(struct evhttp_request *, int, const char *); void evhttp_send_page_(struct evhttp_request *, struct evbuffer *); int evhttp_decode_uri_internal(const char *uri, size_t length, char *ret, int decode_plus); #endif /* _HTTP_H */
Upload File
Create Folder