Lines Matching defs:url

9 #include "http-url.h"
21 struct http_url *url;
33 struct http_url *url = url_parser->url;
81 if (url != NULL) {
82 uri_host_copy(parser->pool, &url->host, &auth.host);
83 url->port = auth.port;
84 url->user = p_strdup(parser->pool, user);
85 url->password = p_strdup(parser->pool, password);
105 struct http_url *url = url_parser->url, *base = url_parser->base;
171 if (url != NULL)
172 url->have_ssl = TRUE;
178 url_parser->url = NULL; /* indicate non-http-url */
233 } else if (!have_authority && url != NULL) {
234 uri_host_copy(parser->pool, &url->host, &base->host);
235 url->port = base->port;
236 url->have_ssl = base->have_ssl;
237 url->user = p_strdup_empty(parser->pool, base->user);
238 url->password = p_strdup_empty(parser->pool, base->password);
250 if (url != NULL)
272 if (url != NULL && pend > pbegin)
281 if (url != NULL) {
288 if (url != NULL)
289 url->path = p_strdup(parser->pool, str_c(fullpath));
290 } else if (relative && url != NULL) {
291 url->path = p_strdup(parser->pool, base->path);
298 if (url != NULL)
299 url->enc_query = p_strdup(parser->pool, part);
300 } else if (relative && !have_path && url != NULL) {
301 url->enc_query = p_strdup(parser->pool, base->enc_query);
312 if (url != NULL)
313 url->enc_fragment = p_strdup(parser->pool, part);
314 } else if (relative && !have_path && url != NULL) {
315 url->enc_fragment = p_strdup(parser->pool, base->enc_fragment);
328 int http_url_parse(const char *url, struct http_url *base,
339 uri_parser_init(&url_parser.parser, pool, url);
342 url_parser.url = p_new(pool, struct http_url, 1);
350 *url_r = url_parser.url;
378 struct http_url *url = p_new(pool, struct http_url, 1);
379 uri_host_copy(pool, &url->host, &auth.host);
380 url->port = auth.port;
381 target->url = url;
393 url_parser.url = p_new(pool, struct http_url, 1);
404 target->url = url_parser.url;
477 http_url_add_scheme(string_t *urlstr, const struct http_url *url)
480 if (!url->have_ssl)
488 http_url_add_authority(string_t *urlstr, const struct http_url *url)
491 uri_append_host(urlstr, &url->host);
493 uri_append_port(urlstr, url->port);
497 http_url_add_target(string_t *urlstr, const struct http_url *url)
499 if (url->path == NULL || *url->path == '\0') {
505 uri_append_path_data(urlstr, "", url->path);
509 if (url->enc_query != NULL) {
511 str_append(urlstr, url->enc_query);
515 const char *http_url_create(const struct http_url *url)
519 http_url_add_scheme(urlstr, url);
520 http_url_add_authority(urlstr, url);
521 http_url_add_target(urlstr, url);
524 if (url->enc_fragment != NULL) {
526 str_append(urlstr, url->enc_fragment);
532 const char *http_url_create_host(const struct http_url *url)
536 http_url_add_scheme(urlstr, url);
537 http_url_add_authority(urlstr, url);
542 const char *http_url_create_authority(const struct http_url *url)
546 http_url_add_authority(urlstr, url);
551 const char *http_url_create_target(const struct http_url *url)
555 http_url_add_target(urlstr, url);