Lines Matching refs:http
211 static int evhttp_find_vhost(struct evhttp *http, struct evhttp **outhttp,
1246 struct evhttp *http = evcon->http_server; in evhttp_connection_free() local
1247 TAILQ_REMOVE(&http->connections, evcon, next); in evhttp_connection_free()
3403 evhttp_find_alias(struct evhttp *http, struct evhttp **outhttp, in evhttp_find_alias() argument
3409 TAILQ_FOREACH(alias, &http->aliases, next) { in evhttp_find_alias()
3413 *outhttp = http; in evhttp_find_alias()
3420 TAILQ_FOREACH(vhost, &http->virtualhosts, next_vhost) { in evhttp_find_alias()
3440 evhttp_find_vhost(struct evhttp *http, struct evhttp **outhttp, in evhttp_find_vhost() argument
3447 if (evhttp_find_alias(http, outhttp, hostname)) in evhttp_find_vhost()
3451 oldhttp = http; in evhttp_find_vhost()
3452 TAILQ_FOREACH(vhost, &http->virtualhosts, next_vhost) { in evhttp_find_vhost()
3455 http = vhost; in evhttp_find_vhost()
3460 } while (oldhttp != http); in evhttp_find_vhost()
3463 *outhttp = http; in evhttp_find_vhost()
3471 struct evhttp *http = arg; in evhttp_handle_request() local
3485 if ((http->allowed_methods & req->type) == 0) { in evhttp_handle_request()
3487 (unsigned)req->type, (unsigned)http->allowed_methods)); in evhttp_handle_request()
3495 evhttp_find_vhost(http, &http, hostname); in evhttp_handle_request()
3498 if ((cb = evhttp_dispatch_callback(&http->callbacks, req)) != NULL) { in evhttp_handle_request()
3504 if (http->gencb) { in evhttp_handle_request()
3505 (*http->gencb)(req, http->gencbarg); in evhttp_handle_request()
3547 struct evhttp *http = arg; in accept_socket_cb() local
3549 evhttp_get_request(http, nfd, peer_sa, peer_socklen); in accept_socket_cb()
3553 evhttp_bind_socket(struct evhttp *http, const char *address, ev_uint16_t port) in evhttp_bind_socket() argument
3556 evhttp_bind_socket_with_handle(http, address, port); in evhttp_bind_socket()
3563 evhttp_bind_socket_with_handle(struct evhttp *http, const char *address, ev_uint16_t port) in evhttp_bind_socket_with_handle() argument
3580 bound = evhttp_accept_socket_with_handle(http, fd); in evhttp_bind_socket_with_handle()
3592 evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd) in evhttp_accept_socket() argument
3595 evhttp_accept_socket_with_handle(http, fd); in evhttp_accept_socket()
3602 evhttp_foreach_bound_socket(struct evhttp *http, in evhttp_foreach_bound_socket() argument
3608 TAILQ_FOREACH(bound, &http->sockets, next) in evhttp_foreach_bound_socket()
3613 evhttp_accept_socket_with_handle(struct evhttp *http, evutil_socket_t fd) in evhttp_accept_socket_with_handle() argument
3620 listener = evconnlistener_new(http->base, NULL, NULL, in evhttp_accept_socket_with_handle()
3627 bound = evhttp_bind_listener(http, listener); in evhttp_accept_socket_with_handle()
3636 evhttp_bind_listener(struct evhttp *http, struct evconnlistener *listener) in evhttp_bind_listener() argument
3645 TAILQ_INSERT_TAIL(&http->sockets, bound, next); in evhttp_bind_listener()
3647 evconnlistener_set_cb(listener, accept_socket_cb, http); in evhttp_bind_listener()
3664 evhttp_del_accept_socket(struct evhttp *http, struct evhttp_bound_socket *bound) in evhttp_del_accept_socket() argument
3666 TAILQ_REMOVE(&http->sockets, bound, next); in evhttp_del_accept_socket()
3674 struct evhttp *http = NULL; in evhttp_new_object() local
3676 if ((http = mm_calloc(1, sizeof(struct evhttp))) == NULL) { in evhttp_new_object()
3681 evutil_timerclear(&http->timeout); in evhttp_new_object()
3682 evhttp_set_max_headers_size(http, EV_SIZE_MAX); in evhttp_new_object()
3683 evhttp_set_max_body_size(http, EV_SIZE_MAX); in evhttp_new_object()
3684 evhttp_set_default_content_type(http, "text/html; charset=ISO-8859-1"); in evhttp_new_object()
3685 evhttp_set_allowed_methods(http, in evhttp_new_object()
3692 TAILQ_INIT(&http->sockets); in evhttp_new_object()
3693 TAILQ_INIT(&http->callbacks); in evhttp_new_object()
3694 TAILQ_INIT(&http->connections); in evhttp_new_object()
3695 TAILQ_INIT(&http->virtualhosts); in evhttp_new_object()
3696 TAILQ_INIT(&http->aliases); in evhttp_new_object()
3698 return (http); in evhttp_new_object()
3704 struct evhttp *http = NULL; in evhttp_new() local
3706 http = evhttp_new_object(); in evhttp_new()
3707 if (http == NULL) in evhttp_new()
3709 http->base = base; in evhttp_new()
3711 return (http); in evhttp_new()
3721 struct evhttp *http = NULL; in evhttp_start() local
3723 http = evhttp_new_object(); in evhttp_start()
3724 if (http == NULL) in evhttp_start()
3726 if (evhttp_bind_socket(http, address, port) == -1) { in evhttp_start()
3727 mm_free(http); in evhttp_start()
3731 return (http); in evhttp_start()
3735 evhttp_free(struct evhttp* http) in evhttp_free() argument
3744 while ((bound = TAILQ_FIRST(&http->sockets)) != NULL) { in evhttp_free()
3745 TAILQ_REMOVE(&http->sockets, bound, next); in evhttp_free()
3752 while ((evcon = TAILQ_FIRST(&http->connections)) != NULL) { in evhttp_free()
3757 while ((http_cb = TAILQ_FIRST(&http->callbacks)) != NULL) { in evhttp_free()
3758 TAILQ_REMOVE(&http->callbacks, http_cb, next); in evhttp_free()
3763 while ((vhost = TAILQ_FIRST(&http->virtualhosts)) != NULL) { in evhttp_free()
3764 TAILQ_REMOVE(&http->virtualhosts, vhost, next_vhost); in evhttp_free()
3769 if (http->vhost_pattern != NULL) in evhttp_free()
3770 mm_free(http->vhost_pattern); in evhttp_free()
3772 while ((alias = TAILQ_FIRST(&http->aliases)) != NULL) { in evhttp_free()
3773 TAILQ_REMOVE(&http->aliases, alias, next); in evhttp_free()
3778 mm_free(http); in evhttp_free()
3782 evhttp_add_virtual_host(struct evhttp* http, const char *pattern, in evhttp_add_virtual_host() argument
3794 TAILQ_INSERT_TAIL(&http->virtualhosts, vhost, next_vhost); in evhttp_add_virtual_host()
3800 evhttp_remove_virtual_host(struct evhttp* http, struct evhttp* vhost) in evhttp_remove_virtual_host() argument
3805 TAILQ_REMOVE(&http->virtualhosts, vhost, next_vhost); in evhttp_remove_virtual_host()
3814 evhttp_add_server_alias(struct evhttp *http, const char *alias) in evhttp_add_server_alias() argument
3828 TAILQ_INSERT_TAIL(&http->aliases, evalias, next); in evhttp_add_server_alias()
3834 evhttp_remove_server_alias(struct evhttp *http, const char *alias) in evhttp_remove_server_alias() argument
3838 TAILQ_FOREACH(evalias, &http->aliases, next) { in evhttp_remove_server_alias()
3840 TAILQ_REMOVE(&http->aliases, evalias, next); in evhttp_remove_server_alias()
3851 evhttp_set_timeout(struct evhttp* http, int timeout_in_secs) in evhttp_set_timeout() argument
3854 evhttp_set_timeout_tv(http, NULL); in evhttp_set_timeout()
3859 evhttp_set_timeout_tv(http, &tv); in evhttp_set_timeout()
3864 evhttp_set_timeout_tv(struct evhttp* http, const struct timeval* tv) in evhttp_set_timeout_tv() argument
3867 http->timeout = *tv; in evhttp_set_timeout_tv()
3869 evutil_timerclear(&http->timeout); in evhttp_set_timeout_tv()
3873 int evhttp_set_flags(struct evhttp *http, int flags) in evhttp_set_flags() argument
3880 http->flags &= ~avail_flags; in evhttp_set_flags()
3882 http->flags |= flags; in evhttp_set_flags()
3888 evhttp_set_max_headers_size(struct evhttp* http, ev_ssize_t max_headers_size) in evhttp_set_max_headers_size() argument
3891 http->default_max_headers_size = EV_SIZE_MAX; in evhttp_set_max_headers_size()
3893 http->default_max_headers_size = max_headers_size; in evhttp_set_max_headers_size()
3897 evhttp_set_max_body_size(struct evhttp* http, ev_ssize_t max_body_size) in evhttp_set_max_body_size() argument
3900 http->default_max_body_size = EV_UINT64_MAX; in evhttp_set_max_body_size()
3902 http->default_max_body_size = max_body_size; in evhttp_set_max_body_size()
3906 evhttp_set_default_content_type(struct evhttp *http, in evhttp_set_default_content_type() argument
3908 http->default_content_type = content_type; in evhttp_set_default_content_type()
3912 evhttp_set_allowed_methods(struct evhttp* http, ev_uint16_t methods) in evhttp_set_allowed_methods() argument
3914 http->allowed_methods = methods; in evhttp_set_allowed_methods()
3918 evhttp_set_cb(struct evhttp *http, const char *uri, in evhttp_set_cb() argument
3923 TAILQ_FOREACH(http_cb, &http->callbacks, next) { in evhttp_set_cb()
3942 TAILQ_INSERT_TAIL(&http->callbacks, http_cb, next); in evhttp_set_cb()
3948 evhttp_del_cb(struct evhttp *http, const char *uri) in evhttp_del_cb() argument
3952 TAILQ_FOREACH(http_cb, &http->callbacks, next) { in evhttp_del_cb()
3959 TAILQ_REMOVE(&http->callbacks, http_cb, next); in evhttp_del_cb()
3967 evhttp_set_gencb(struct evhttp *http, in evhttp_set_gencb() argument
3970 http->gencb = cb; in evhttp_set_gencb()
3971 http->gencbarg = cbarg; in evhttp_set_gencb()
3975 evhttp_set_bevcb(struct evhttp *http, in evhttp_set_bevcb() argument
3978 http->bevcb = cb; in evhttp_set_bevcb()
3979 http->bevcbarg = cbarg; in evhttp_set_bevcb()
4229 struct evhttp* http, in evhttp_get_request_connection() argument
4254 if (http->bevcb != NULL) { in evhttp_get_request_connection()
4255 bev = (*http->bevcb)(http->base, http->bevcbarg); in evhttp_get_request_connection()
4258 http->base, NULL, bev, hostname, atoi(portname)); in evhttp_get_request_connection()
4264 evcon->max_headers_size = http->default_max_headers_size; in evhttp_get_request_connection()
4265 evcon->max_body_size = http->default_max_body_size; in evhttp_get_request_connection()
4266 if (http->flags & EVHTTP_SERVER_LINGERING_CLOSE) in evhttp_get_request_connection()
4292 struct evhttp *http = evcon->http_server; in evhttp_associate_new_request_with_connection() local
4294 if ((req = evhttp_request_new(evhttp_handle_request, http)) == NULL) in evhttp_associate_new_request_with_connection()
4325 evhttp_get_request(struct evhttp *http, evutil_socket_t fd, in evhttp_get_request() argument
4330 evcon = evhttp_get_request_connection(http, fd, sa, salen); in evhttp_get_request()
4339 if (evutil_timerisset(&http->timeout)) in evhttp_get_request()
4340 evhttp_connection_set_timeout_tv(evcon, &http->timeout); in evhttp_get_request()
4346 evcon->http_server = http; in evhttp_get_request()
4347 TAILQ_INSERT_TAIL(&http->connections, evcon, next); in evhttp_get_request()