Lines Matching refs:uri

452 	    method, req->uri, req->major, req->minor);  in evhttp_make_header_request()
694 if (req->uri) { in evhttp_connection_incoming_fail()
695 mm_free(req->uri); in evhttp_connection_incoming_fail()
696 req->uri = NULL; in evhttp_connection_incoming_fail()
1722 char *uri; in evhttp_parse_request_line() local
1741 uri = line; in evhttp_parse_request_line()
1742 version = strrchr(uri, ' '); in evhttp_parse_request_line()
1743 if (!version || uri == version) in evhttp_parse_request_line()
1748 method_len = (uri - method) - 1; in evhttp_parse_request_line()
1868 if ((req->uri = mm_strdup(uri)) == NULL) { in evhttp_parse_request_line()
1874 if ((req->uri_elems = evhttp_uri_parse_authority(req->uri)) == NULL) { in evhttp_parse_request_line()
1878 if ((req->uri_elems = evhttp_uri_parse_with_flags(req->uri, in evhttp_parse_request_line()
2650 enum evhttp_cmd_type type, const char *uri) in evhttp_make_request() argument
2655 if (req->uri != NULL) in evhttp_make_request()
2656 mm_free(req->uri); in evhttp_make_request()
2657 if ((req->uri = mm_strdup(uri)) == NULL) { in evhttp_make_request()
3110 evhttp_uriencode(const char *uri, ev_ssize_t len, int space_as_plus) in evhttp_uriencode() argument
3121 if (uri + len < uri) { in evhttp_uriencode()
3125 end = uri + len; in evhttp_uriencode()
3127 size_t slen = strlen(uri); in evhttp_uriencode()
3134 if (uri + slen < uri) { in evhttp_uriencode()
3138 end = uri + slen; in evhttp_uriencode()
3141 for (p = uri; p < end; p++) { in evhttp_uriencode()
3177 const char *uri, size_t length, char *ret, int decode_plus_ctl) in evhttp_decode_uri_internal() argument
3185 c = uri[i]; in evhttp_decode_uri_internal()
3192 EVUTIL_ISXDIGIT_(uri[i+1]) && EVUTIL_ISXDIGIT_(uri[i+2])) { in evhttp_decode_uri_internal()
3194 tmp[0] = uri[i+1]; in evhttp_decode_uri_internal()
3195 tmp[1] = uri[i+2]; in evhttp_decode_uri_internal()
3209 evhttp_decode_uri(const char *uri) in evhttp_decode_uri() argument
3213 if ((ret = mm_malloc(strlen(uri) + 1)) == NULL) { in evhttp_decode_uri()
3215 (unsigned long)(strlen(uri) + 1)); in evhttp_decode_uri()
3219 evhttp_decode_uri_internal(uri, strlen(uri), in evhttp_decode_uri()
3226 evhttp_uridecode(const char *uri, int decode_plus, size_t *size_out) in evhttp_uridecode() argument
3231 if ((ret = mm_malloc(strlen(uri) + 1)) == NULL) { in evhttp_uridecode()
3233 (unsigned long)(strlen(uri) + 1)); in evhttp_uridecode()
3237 n = evhttp_decode_uri_internal(uri, strlen(uri), in evhttp_uridecode()
3262 struct evhttp_uri *uri=NULL; in evhttp_parse_query_impl() local
3267 uri = evhttp_uri_parse(str); in evhttp_parse_query_impl()
3268 if (!uri) in evhttp_parse_query_impl()
3270 query_part = evhttp_uri_get_query(uri); in evhttp_parse_query_impl()
3318 if (uri) in evhttp_parse_query_impl()
3319 evhttp_uri_free(uri); in evhttp_parse_query_impl()
3324 evhttp_parse_query(const char *uri, struct evkeyvalq *headers) in evhttp_parse_query() argument
3326 return evhttp_parse_query_impl(uri, headers, 1); in evhttp_parse_query()
3329 evhttp_parse_query_str(const char *uri, struct evkeyvalq *headers) in evhttp_parse_query_str() argument
3331 return evhttp_parse_query_impl(uri, headers, 0); in evhttp_parse_query_str()
3476 if (req->type == 0 || req->uri == NULL) { in evhttp_handle_request()
3515 if ((escaped_html = evhttp_htmlescape(req->uri)) == NULL) { in evhttp_handle_request()
3914 evhttp_set_cb(struct evhttp *http, const char *uri, in evhttp_set_cb() argument
3920 if (strcmp(http_cb->what, uri) == 0) in evhttp_set_cb()
3929 http_cb->what = mm_strdup(uri); in evhttp_set_cb()
3944 evhttp_del_cb(struct evhttp *http, const char *uri) in evhttp_del_cb() argument
3949 if (strcmp(http_cb->what, uri) == 0) in evhttp_del_cb()
4042 if (req->uri != NULL) in evhttp_request_free()
4043 mm_free(req->uri); in evhttp_request_free()
4125 if (req->uri == NULL) in evhttp_request_get_uri()
4127 return (req->uri); in evhttp_request_get_uri()
4494 struct evhttp_uri *uri = mm_calloc(sizeof(struct evhttp_uri), 1); in evhttp_uri_new() local
4495 if (uri) in evhttp_uri_new()
4496 uri->port = -1; in evhttp_uri_new()
4497 return uri; in evhttp_uri_new()
4501 evhttp_uri_set_flags(struct evhttp_uri *uri, unsigned flags) in evhttp_uri_set_flags() argument
4503 uri->flags = flags; in evhttp_uri_set_flags()
4627 parse_authority(struct evhttp_uri *uri, char *s, char *eos) in parse_authority() argument
4632 uri->host = mm_strdup(""); in parse_authority()
4633 if (uri->host == NULL) { in parse_authority()
4647 uri->userinfo = mm_strdup(s); in parse_authority()
4648 if (uri->userinfo == NULL) { in parse_authority()
4661 uri->port = -1; in parse_authority()
4662 else if ((uri->port = parse_port(port+1, eos))<0) in parse_authority()
4678 uri->host = mm_malloc(eos-cp+1); in parse_authority()
4679 if (uri->host == NULL) { in parse_authority()
4683 memcpy(uri->host, cp, eos-cp); in parse_authority()
4684 uri->host[eos-cp] = '\0'; in parse_authority()
4777 struct evhttp_uri *uri = mm_calloc(1, sizeof(struct evhttp_uri)); in evhttp_uri_parse_with_flags() local
4778 if (uri == NULL) { in evhttp_uri_parse_with_flags()
4782 uri->port = -1; in evhttp_uri_parse_with_flags()
4783 uri->flags = flags; in evhttp_uri_parse_with_flags()
4806 uri->scheme = mm_strdup(readp); in evhttp_uri_parse_with_flags()
4807 if (uri->scheme == NULL) { in evhttp_uri_parse_with_flags()
4820 if (parse_authority(uri, authority, path) < 0) in evhttp_uri_parse_with_flags()
4862 if (! uri->scheme && !path_matches_noscheme(path)) in evhttp_uri_parse_with_flags()
4866 uri->path = mm_strdup(path); in evhttp_uri_parse_with_flags()
4867 if (uri->path == NULL) { in evhttp_uri_parse_with_flags()
4873 uri->query = mm_strdup(query); in evhttp_uri_parse_with_flags()
4874 if (uri->query == NULL) { in evhttp_uri_parse_with_flags()
4880 uri->fragment = mm_strdup(fragment); in evhttp_uri_parse_with_flags()
4881 if (uri->fragment == NULL) { in evhttp_uri_parse_with_flags()
4889 return uri; in evhttp_uri_parse_with_flags()
4891 if (uri) in evhttp_uri_parse_with_flags()
4892 evhttp_uri_free(uri); in evhttp_uri_parse_with_flags()
4901 struct evhttp_uri *uri = mm_calloc(1, sizeof(struct evhttp_uri)); in evhttp_uri_parse_authority() local
4904 if (uri == NULL) { in evhttp_uri_parse_authority()
4908 uri->port = -1; in evhttp_uri_parse_authority()
4909 uri->flags = 0; in evhttp_uri_parse_authority()
4912 if (parse_authority(uri, source_uri, end) < 0) in evhttp_uri_parse_authority()
4915 uri->path = mm_strdup(""); in evhttp_uri_parse_authority()
4916 if (uri->path == NULL) { in evhttp_uri_parse_authority()
4921 return uri; in evhttp_uri_parse_authority()
4923 if (uri) in evhttp_uri_parse_authority()
4924 evhttp_uri_free(uri); in evhttp_uri_parse_authority()
4929 evhttp_uri_free(struct evhttp_uri *uri) in evhttp_uri_free() argument
4932 if (uri->f) { \ in evhttp_uri_free()
4933 mm_free(uri->f); \ in evhttp_uri_free()
4943 mm_free(uri); in evhttp_uri_free()
4948 evhttp_uri_join(struct evhttp_uri *uri, char *buf, size_t limit) in evhttp_uri_join() argument
4954 #define URI_ADD_(f) evbuffer_add(tmp, uri->f, strlen(uri->f)) in evhttp_uri_join()
4956 if (!uri || !buf || !limit) in evhttp_uri_join()
4963 if (uri->scheme) { in evhttp_uri_join()
4967 if (uri->host) { in evhttp_uri_join()
4969 if (uri->userinfo) in evhttp_uri_join()
4970 evbuffer_add_printf(tmp,"%s@", uri->userinfo); in evhttp_uri_join()
4972 if (uri->port >= 0) in evhttp_uri_join()
4973 evbuffer_add_printf(tmp,":%d", uri->port); in evhttp_uri_join()
4975 if (uri->path && uri->path[0] != '/' && uri->path[0] != '\0') in evhttp_uri_join()
4979 if (uri->path) in evhttp_uri_join()
4982 if (uri->query) { in evhttp_uri_join()
4987 if (uri->fragment) { in evhttp_uri_join()
5012 evhttp_uri_get_scheme(const struct evhttp_uri *uri) in evhttp_uri_get_scheme() argument
5014 return uri->scheme; in evhttp_uri_get_scheme()
5017 evhttp_uri_get_userinfo(const struct evhttp_uri *uri) in evhttp_uri_get_userinfo() argument
5019 return uri->userinfo; in evhttp_uri_get_userinfo()
5022 evhttp_uri_get_host(const struct evhttp_uri *uri) in evhttp_uri_get_host() argument
5024 return uri->host; in evhttp_uri_get_host()
5027 evhttp_uri_get_port(const struct evhttp_uri *uri) in evhttp_uri_get_port() argument
5029 return uri->port; in evhttp_uri_get_port()
5032 evhttp_uri_get_path(const struct evhttp_uri *uri) in evhttp_uri_get_path() argument
5034 return uri->path; in evhttp_uri_get_path()
5037 evhttp_uri_get_query(const struct evhttp_uri *uri) in evhttp_uri_get_query() argument
5039 return uri->query; in evhttp_uri_get_query()
5042 evhttp_uri_get_fragment(const struct evhttp_uri *uri) in evhttp_uri_get_fragment() argument
5044 return uri->fragment; in evhttp_uri_get_fragment()
5048 if (uri->f) \
5049 mm_free(uri->f); \
5051 if ((uri->f = mm_strdup(f)) == NULL) { \
5056 uri->f = NULL; \
5061 evhttp_uri_set_scheme(struct evhttp_uri *uri, const char *scheme) in evhttp_uri_set_scheme() argument
5070 evhttp_uri_set_userinfo(struct evhttp_uri *uri, const char *userinfo) in evhttp_uri_set_userinfo() argument
5078 evhttp_uri_set_host(struct evhttp_uri *uri, const char *host) in evhttp_uri_set_host() argument
5094 evhttp_uri_set_port(struct evhttp_uri *uri, int port) in evhttp_uri_set_port() argument
5098 uri->port = port; in evhttp_uri_set_port()
5105 evhttp_uri_set_path(struct evhttp_uri *uri, const char *path) in evhttp_uri_set_path() argument
5107 if (path && end_of_cpath(path, PART_PATH, uri->flags) != path+strlen(path)) in evhttp_uri_set_path()
5114 evhttp_uri_set_query(struct evhttp_uri *uri, const char *query) in evhttp_uri_set_query() argument
5116 if (query && end_of_cpath(query, PART_QUERY, uri->flags) != query+strlen(query)) in evhttp_uri_set_query()
5122 evhttp_uri_set_fragment(struct evhttp_uri *uri, const char *fragment) in evhttp_uri_set_fragment() argument
5124 if (fragment && end_of_cpath(fragment, PART_FRAGMENT, uri->flags) != fragment+strlen(fragment)) in evhttp_uri_set_fragment()