Lines Matching refs:http
207 static int evhttp_find_vhost(struct evhttp *http, struct evhttp **outhttp,
1242 struct evhttp *http = evcon->http_server; in evhttp_connection_free() local
1243 TAILQ_REMOVE(&http->connections, evcon, next); in evhttp_connection_free()
3399 evhttp_find_alias(struct evhttp *http, struct evhttp **outhttp, in evhttp_find_alias() argument
3405 TAILQ_FOREACH(alias, &http->aliases, next) { in evhttp_find_alias()
3409 *outhttp = http; in evhttp_find_alias()
3416 TAILQ_FOREACH(vhost, &http->virtualhosts, next_vhost) { in evhttp_find_alias()
3436 evhttp_find_vhost(struct evhttp *http, struct evhttp **outhttp, in evhttp_find_vhost() argument
3443 if (evhttp_find_alias(http, outhttp, hostname)) in evhttp_find_vhost()
3447 oldhttp = http; in evhttp_find_vhost()
3448 TAILQ_FOREACH(vhost, &http->virtualhosts, next_vhost) { in evhttp_find_vhost()
3451 http = vhost; in evhttp_find_vhost()
3456 } while (oldhttp != http); in evhttp_find_vhost()
3459 *outhttp = http; in evhttp_find_vhost()
3467 struct evhttp *http = arg; in evhttp_handle_request() local
3481 if ((http->allowed_methods & req->type) == 0) { in evhttp_handle_request()
3483 (unsigned)req->type, (unsigned)http->allowed_methods)); in evhttp_handle_request()
3491 evhttp_find_vhost(http, &http, hostname); in evhttp_handle_request()
3494 if ((cb = evhttp_dispatch_callback(&http->callbacks, req)) != NULL) { in evhttp_handle_request()
3500 if (http->gencb) { in evhttp_handle_request()
3501 (*http->gencb)(req, http->gencbarg); in evhttp_handle_request()
3543 struct evhttp *http = arg; in accept_socket_cb() local
3545 evhttp_get_request(http, nfd, peer_sa, peer_socklen); in accept_socket_cb()
3549 evhttp_bind_socket(struct evhttp *http, const char *address, ev_uint16_t port) in evhttp_bind_socket() argument
3552 evhttp_bind_socket_with_handle(http, address, port); in evhttp_bind_socket()
3559 evhttp_bind_socket_with_handle(struct evhttp *http, const char *address, ev_uint16_t port) in evhttp_bind_socket_with_handle() argument
3576 bound = evhttp_accept_socket_with_handle(http, fd); in evhttp_bind_socket_with_handle()
3588 evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd) in evhttp_accept_socket() argument
3591 evhttp_accept_socket_with_handle(http, fd); in evhttp_accept_socket()
3598 evhttp_foreach_bound_socket(struct evhttp *http, in evhttp_foreach_bound_socket() argument
3604 TAILQ_FOREACH(bound, &http->sockets, next) in evhttp_foreach_bound_socket()
3609 evhttp_accept_socket_with_handle(struct evhttp *http, evutil_socket_t fd) in evhttp_accept_socket_with_handle() argument
3616 listener = evconnlistener_new(http->base, NULL, NULL, in evhttp_accept_socket_with_handle()
3623 bound = evhttp_bind_listener(http, listener); in evhttp_accept_socket_with_handle()
3632 evhttp_bind_listener(struct evhttp *http, struct evconnlistener *listener) in evhttp_bind_listener() argument
3641 TAILQ_INSERT_TAIL(&http->sockets, bound, next); in evhttp_bind_listener()
3643 evconnlistener_set_cb(listener, accept_socket_cb, http); in evhttp_bind_listener()
3660 evhttp_del_accept_socket(struct evhttp *http, struct evhttp_bound_socket *bound) in evhttp_del_accept_socket() argument
3662 TAILQ_REMOVE(&http->sockets, bound, next); in evhttp_del_accept_socket()
3670 struct evhttp *http = NULL; in evhttp_new_object() local
3672 if ((http = mm_calloc(1, sizeof(struct evhttp))) == NULL) { in evhttp_new_object()
3677 evutil_timerclear(&http->timeout); in evhttp_new_object()
3678 evhttp_set_max_headers_size(http, EV_SIZE_MAX); in evhttp_new_object()
3679 evhttp_set_max_body_size(http, EV_SIZE_MAX); in evhttp_new_object()
3680 evhttp_set_default_content_type(http, "text/html; charset=ISO-8859-1"); in evhttp_new_object()
3681 evhttp_set_allowed_methods(http, in evhttp_new_object()
3688 TAILQ_INIT(&http->sockets); in evhttp_new_object()
3689 TAILQ_INIT(&http->callbacks); in evhttp_new_object()
3690 TAILQ_INIT(&http->connections); in evhttp_new_object()
3691 TAILQ_INIT(&http->virtualhosts); in evhttp_new_object()
3692 TAILQ_INIT(&http->aliases); in evhttp_new_object()
3694 return (http); in evhttp_new_object()
3700 struct evhttp *http = NULL; in evhttp_new() local
3702 http = evhttp_new_object(); in evhttp_new()
3703 if (http == NULL) in evhttp_new()
3705 http->base = base; in evhttp_new()
3707 return (http); in evhttp_new()
3717 struct evhttp *http = NULL; in evhttp_start() local
3719 http = evhttp_new_object(); in evhttp_start()
3720 if (http == NULL) in evhttp_start()
3722 if (evhttp_bind_socket(http, address, port) == -1) { in evhttp_start()
3723 mm_free(http); in evhttp_start()
3727 return (http); in evhttp_start()
3731 evhttp_free(struct evhttp* http) in evhttp_free() argument
3740 while ((bound = TAILQ_FIRST(&http->sockets)) != NULL) { in evhttp_free()
3741 TAILQ_REMOVE(&http->sockets, bound, next); in evhttp_free()
3748 while ((evcon = TAILQ_FIRST(&http->connections)) != NULL) { in evhttp_free()
3753 while ((http_cb = TAILQ_FIRST(&http->callbacks)) != NULL) { in evhttp_free()
3754 TAILQ_REMOVE(&http->callbacks, http_cb, next); in evhttp_free()
3759 while ((vhost = TAILQ_FIRST(&http->virtualhosts)) != NULL) { in evhttp_free()
3760 TAILQ_REMOVE(&http->virtualhosts, vhost, next_vhost); in evhttp_free()
3765 if (http->vhost_pattern != NULL) in evhttp_free()
3766 mm_free(http->vhost_pattern); in evhttp_free()
3768 while ((alias = TAILQ_FIRST(&http->aliases)) != NULL) { in evhttp_free()
3769 TAILQ_REMOVE(&http->aliases, alias, next); in evhttp_free()
3774 mm_free(http); in evhttp_free()
3778 evhttp_add_virtual_host(struct evhttp* http, const char *pattern, in evhttp_add_virtual_host() argument
3790 TAILQ_INSERT_TAIL(&http->virtualhosts, vhost, next_vhost); in evhttp_add_virtual_host()
3796 evhttp_remove_virtual_host(struct evhttp* http, struct evhttp* vhost) in evhttp_remove_virtual_host() argument
3801 TAILQ_REMOVE(&http->virtualhosts, vhost, next_vhost); in evhttp_remove_virtual_host()
3810 evhttp_add_server_alias(struct evhttp *http, const char *alias) in evhttp_add_server_alias() argument
3824 TAILQ_INSERT_TAIL(&http->aliases, evalias, next); in evhttp_add_server_alias()
3830 evhttp_remove_server_alias(struct evhttp *http, const char *alias) in evhttp_remove_server_alias() argument
3834 TAILQ_FOREACH(evalias, &http->aliases, next) { in evhttp_remove_server_alias()
3836 TAILQ_REMOVE(&http->aliases, evalias, next); in evhttp_remove_server_alias()
3847 evhttp_set_timeout(struct evhttp* http, int timeout_in_secs) in evhttp_set_timeout() argument
3850 evhttp_set_timeout_tv(http, NULL); in evhttp_set_timeout()
3855 evhttp_set_timeout_tv(http, &tv); in evhttp_set_timeout()
3860 evhttp_set_timeout_tv(struct evhttp* http, const struct timeval* tv) in evhttp_set_timeout_tv() argument
3863 http->timeout = *tv; in evhttp_set_timeout_tv()
3865 evutil_timerclear(&http->timeout); in evhttp_set_timeout_tv()
3869 int evhttp_set_flags(struct evhttp *http, int flags) in evhttp_set_flags() argument
3876 http->flags &= ~avail_flags; in evhttp_set_flags()
3878 http->flags |= flags; in evhttp_set_flags()
3884 evhttp_set_max_headers_size(struct evhttp* http, ev_ssize_t max_headers_size) in evhttp_set_max_headers_size() argument
3887 http->default_max_headers_size = EV_SIZE_MAX; in evhttp_set_max_headers_size()
3889 http->default_max_headers_size = max_headers_size; in evhttp_set_max_headers_size()
3893 evhttp_set_max_body_size(struct evhttp* http, ev_ssize_t max_body_size) in evhttp_set_max_body_size() argument
3896 http->default_max_body_size = EV_UINT64_MAX; in evhttp_set_max_body_size()
3898 http->default_max_body_size = max_body_size; in evhttp_set_max_body_size()
3902 evhttp_set_default_content_type(struct evhttp *http, in evhttp_set_default_content_type() argument
3904 http->default_content_type = content_type; in evhttp_set_default_content_type()
3908 evhttp_set_allowed_methods(struct evhttp* http, ev_uint16_t methods) in evhttp_set_allowed_methods() argument
3910 http->allowed_methods = methods; in evhttp_set_allowed_methods()
3914 evhttp_set_cb(struct evhttp *http, const char *uri, in evhttp_set_cb() argument
3919 TAILQ_FOREACH(http_cb, &http->callbacks, next) { in evhttp_set_cb()
3938 TAILQ_INSERT_TAIL(&http->callbacks, http_cb, next); in evhttp_set_cb()
3944 evhttp_del_cb(struct evhttp *http, const char *uri) in evhttp_del_cb() argument
3948 TAILQ_FOREACH(http_cb, &http->callbacks, next) { in evhttp_del_cb()
3955 TAILQ_REMOVE(&http->callbacks, http_cb, next); in evhttp_del_cb()
3963 evhttp_set_gencb(struct evhttp *http, in evhttp_set_gencb() argument
3966 http->gencb = cb; in evhttp_set_gencb()
3967 http->gencbarg = cbarg; in evhttp_set_gencb()
3971 evhttp_set_bevcb(struct evhttp *http, in evhttp_set_bevcb() argument
3974 http->bevcb = cb; in evhttp_set_bevcb()
3975 http->bevcbarg = cbarg; in evhttp_set_bevcb()
4225 struct evhttp* http, in evhttp_get_request_connection() argument
4250 if (http->bevcb != NULL) { in evhttp_get_request_connection()
4251 bev = (*http->bevcb)(http->base, http->bevcbarg); in evhttp_get_request_connection()
4254 http->base, NULL, bev, hostname, atoi(portname)); in evhttp_get_request_connection()
4260 evcon->max_headers_size = http->default_max_headers_size; in evhttp_get_request_connection()
4261 evcon->max_body_size = http->default_max_body_size; in evhttp_get_request_connection()
4262 if (http->flags & EVHTTP_SERVER_LINGERING_CLOSE) in evhttp_get_request_connection()
4288 struct evhttp *http = evcon->http_server; in evhttp_associate_new_request_with_connection() local
4290 if ((req = evhttp_request_new(evhttp_handle_request, http)) == NULL) in evhttp_associate_new_request_with_connection()
4321 evhttp_get_request(struct evhttp *http, evutil_socket_t fd, in evhttp_get_request() argument
4326 evcon = evhttp_get_request_connection(http, fd, sa, salen); in evhttp_get_request()
4335 if (evutil_timerisset(&http->timeout)) in evhttp_get_request()
4336 evhttp_connection_set_timeout_tv(evcon, &http->timeout); in evhttp_get_request()
4342 evcon->http_server = http; in evhttp_get_request()
4343 TAILQ_INSERT_TAIL(&http->connections, evcon, next); in evhttp_get_request()