• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/transmission/libevent-2.0.20-stable/

Lines Matching refs:http

90 #include "event2/http.h"
101 #include "http-internal.h"
198 static int evhttp_find_vhost(struct evhttp *http, struct evhttp **outhttp,
589 /** Generate all headers appropriate for sending the http request in req (or
712 * or an http layer error. for problems on the network
752 * http connection's bufferevent */
1146 struct evhttp *http = evcon->http_server;
1147 TAILQ_REMOVE(&http->connections, evcon, next);
1227 least likely to disrupt the rest of the bufferevent and http code.
1576 /* If we have an absolute-URI, check to see if it is an http request
1581 if (scheme && (!evutil_ascii_strcasecmp(scheme, "http") ||
2922 Search the vhost hierarchy beginning with http for a server alias
2924 outhttp is set to the matching http object and 1 is returned.
2928 evhttp_find_alias(struct evhttp *http, struct evhttp **outhttp,
2934 TAILQ_FOREACH(alias, &http->aliases, next) {
2938 *outhttp = http;
2945 TAILQ_FOREACH(vhost, &http->virtualhosts, next_vhost) {
2954 Attempts to find the best http object to handle a request for a hostname.
2955 All aliases for the root http object and vhosts are searched for an exact
2960 is set with the best matching http object. If there are no matches, the
2961 root http object is stored in outhttp and 0 is returned.
2965 evhttp_find_vhost(struct evhttp *http, struct evhttp **outhttp,
2972 if (evhttp_find_alias(http, outhttp, hostname))
2976 oldhttp = http;
2977 TAILQ_FOREACH(vhost, &http->virtualhosts, next_vhost) {
2980 http = vhost;
2985 } while (oldhttp != http);
2988 *outhttp = http;
2996 struct evhttp *http = arg;
3008 if ((http->allowed_methods & req->type) == 0) {
3010 (unsigned)req->type, (unsigned)http->allowed_methods));
3018 evhttp_find_vhost(http, &http, hostname);
3021 if ((cb = evhttp_dispatch_callback(&http->callbacks, req)) != NULL) {
3027 if (http->gencb) {
3028 (*http->gencb)(req, http->gencbarg);
3070 struct evhttp *http = arg;
3072 evhttp_get_request(http, nfd, peer_sa, peer_socklen);
3076 evhttp_bind_socket(struct evhttp *http, const char *address, ev_uint16_t port)
3079 evhttp_bind_socket_with_handle(http, address, port);
3086 evhttp_bind_socket_with_handle(struct evhttp *http, const char *address, ev_uint16_t port)
3100 bound = evhttp_accept_socket_with_handle(http, fd);
3112 evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd)
3115 evhttp_accept_socket_with_handle(http, fd);
3123 evhttp_accept_socket_with_handle(struct evhttp *http, evutil_socket_t fd)
3130 listener = evconnlistener_new(http->base, NULL, NULL,
3137 bound = evhttp_bind_listener(http, listener);
3146 evhttp_bind_listener(struct evhttp *http, struct evconnlistener *listener)
3155 TAILQ_INSERT_TAIL(&http->sockets, bound, next);
3157 evconnlistener_set_cb(listener, accept_socket_cb, http);
3174 evhttp_del_accept_socket(struct evhttp *http, struct evhttp_bound_socket *bound)
3176 TAILQ_REMOVE(&http->sockets, bound, next);
3184 struct evhttp *http = NULL;
3186 if ((http = mm_calloc(1, sizeof(struct evhttp))) == NULL) {
3191 http->timeout = -1;
3192 evhttp_set_max_headers_size(http, EV_SIZE_MAX);
3193 evhttp_set_max_body_size(http, EV_SIZE_MAX);
3194 evhttp_set_allowed_methods(http,
3201 TAILQ_INIT(&http->sockets);
3202 TAILQ_INIT(&http->callbacks);
3203 TAILQ_INIT(&http->connections);
3204 TAILQ_INIT(&http->virtualhosts);
3205 TAILQ_INIT(&http->aliases);
3207 return (http);
3213 struct evhttp *http = NULL;
3215 http = evhttp_new_object();
3216 if (http == NULL)
3218 http->base = base;
3220 return (http);
3230 struct evhttp *http = NULL;
3232 http = evhttp_new_object();
3233 if (http == NULL)
3235 if (evhttp_bind_socket(http, address, port) == -1) {
3236 mm_free(http);
3240 return (http);
3244 evhttp_free(struct evhttp* http)
3253 while ((bound = TAILQ_FIRST(&http->sockets)) != NULL) {
3254 TAILQ_REMOVE(&http->sockets, bound, next);
3261 while ((evcon = TAILQ_FIRST(&http->connections)) != NULL) {
3266 while ((http_cb = TAILQ_FIRST(&http->callbacks)) != NULL) {
3267 TAILQ_REMOVE(&http->callbacks, http_cb, next);
3272 while ((vhost = TAILQ_FIRST(&http->virtualhosts)) != NULL) {
3273 TAILQ_REMOVE(&http->virtualhosts, vhost, next_vhost);
3278 if (http->vhost_pattern != NULL)
3279 mm_free(http->vhost_pattern);
3281 while ((alias = TAILQ_FIRST(&http->aliases)) != NULL) {
3282 TAILQ_REMOVE(&http->aliases, alias, next);
3287 mm_free(http);
3291 evhttp_add_virtual_host(struct evhttp* http, const char *pattern,
3303 TAILQ_INSERT_TAIL(&http->virtualhosts, vhost, next_vhost);
3309 evhttp_remove_virtual_host(struct evhttp* http, struct evhttp* vhost)
3314 TAILQ_REMOVE(&http->virtualhosts, vhost, next_vhost);
3323 evhttp_add_server_alias(struct evhttp *http, const char *alias)
3337 TAILQ_INSERT_TAIL(&http->aliases, evalias, next);
3343 evhttp_remove_server_alias(struct evhttp *http, const char *alias)
3347 TAILQ_FOREACH(evalias, &http->aliases, next) {
3349 TAILQ_REMOVE(&http->aliases, evalias, next);
3360 evhttp_set_timeout(struct evhttp* http, int timeout_in_secs)
3362 http->timeout = timeout_in_secs;
3366 evhttp_set_max_headers_size(struct evhttp* http, ev_ssize_t max_headers_size)
3369 http->default_max_headers_size = EV_SIZE_MAX;
3371 http->default_max_headers_size = max_headers_size;
3375 evhttp_set_max_body_size(struct evhttp* http, ev_ssize_t max_body_size)
3378 http->default_max_body_size = EV_UINT64_MAX;
3380 http->default_max_body_size = max_body_size;
3384 evhttp_set_allowed_methods(struct evhttp* http, ev_uint16_t methods)
3386 http->allowed_methods = methods;
3390 evhttp_set_cb(struct evhttp *http, const char *uri,
3395 TAILQ_FOREACH(http_cb, &http->callbacks, next) {
3414 TAILQ_INSERT_TAIL(&http->callbacks, http_cb, next);
3420 evhttp_del_cb(struct evhttp *http, const char *uri)
3424 TAILQ_FOREACH(http_cb, &http->callbacks, next) {
3431 TAILQ_REMOVE(&http->callbacks, http_cb, next);
3439 evhttp_set_gencb(struct evhttp *http,
3442 http->gencb = cb;
3443 http->gencbarg = cbarg;
3665 struct evhttp* http,
3681 /* we need a connection object to put the http request on */
3683 http->base, NULL, hostname, atoi(portname));
3689 evcon->max_headers_size = http->default_max_headers_size;
3690 evcon->max_body_size = http->default_max_body_size;
3705 struct evhttp *http = evcon->http_server;
3707 if ((req = evhttp_request_new(evhttp_handle_request, http)) == NULL)
3738 evhttp_get_request(struct evhttp *http, evutil_socket_t fd,
3743 evcon = evhttp_get_request_connection(http, fd, sa, salen);
3751 if (http->timeout != -1)
3752 evhttp_connection_set_timeout(evcon, http->timeout);
3756 * we need to know which http server it belongs to.
3758 evcon->http_server = http;
3759 TAILQ_INSERT_TAIL(&http->connections, evcon, next);
3903 char *scheme; /* scheme; e.g http, ftp etc */