Lines Matching defs:url
13 #include "imap-url.h"
121 struct imap_url *url;
173 struct imap_url *url = url_parser->url;
241 if (url != NULL && uend > auth.enc_userinfo) {
244 url->userid = p_strdup(parser->pool, data);
254 if (url != NULL) {
257 url->auth_type = p_strdup(parser->pool, data);
262 if (url != NULL) {
263 url->host = auth.host;
264 url->port = auth.port;
273 struct imap_url *url = url_parser->url;
318 if (url != NULL)
319 url->uauth_expire = expire;
346 if (url != NULL) {
347 url->uauth_access_application =
364 if (url != NULL) {
365 url->uauth_access_application =
367 url->uauth_access_user = p_strdup(parser->pool, data);
371 if (url != NULL) {
372 /* get rump url */
374 url->uauth_rumpurl = p_strdup_until(parser->pool,
377 url->uauth_rumpurl = p_strconcat(parser->pool, "imap:",
384 /* rump url; caller should check whether this is appropriate */
403 if (url != NULL) {
405 url->uauth_mechanism = p_strdup_until(parser->pool, q, p);
422 if (url != NULL) {
423 url->uauth_token = uauth_token->data;
424 url->uauth_token_size = uauth_token->used;
435 struct imap_url *url = url_parser->url;
481 if (url != NULL && url_parser->base != NULL && relative > 0) {
746 if (url != NULL) {
748 url->mailbox = p_strdup(parser->pool, str_c(mailbox));
749 url->uidvalidity = uidvalidity;
750 url->uid = uid;
752 url->section = p_strdup(parser->pool, str_c(section));
753 url->have_partial = have_partial;
754 url->partial_offset = partial_offset;
755 url->partial_size = partial_size;
830 /* Relative urls are only valid when we have a base url */
835 } else if (url_parser->url != NULL) {
836 struct imap_url *url = url_parser->url;
839 uri_host_copy(parser->pool, &url->host, &base->host);
840 url->port = base->port;
841 url->userid = p_strdup_empty(parser->pool, base->userid);
842 url->auth_type = p_strdup_empty(parser->pool, base->auth_type);
869 if (url_parser->url != NULL) {
872 url_parser->url->search_program =
892 int imap_url_parse(const char *url, const struct imap_url *base,
904 uri_parser_init(&url_parser.parser, pool_datastack_create(), url);
906 url_parser.url = t_new(struct imap_url, 1);
907 url_parser.url->uauth_expire = (time_t)-1;
915 *url_r = url_parser.url;
924 imap_url_append_mailbox(const struct imap_url *url, string_t *urlstr)
926 uri_append_path_data(urlstr, ";", url->mailbox);
927 if (url->uidvalidity != 0)
928 str_printfa(urlstr, ";UIDVALIDITY=%u", url->uidvalidity);
929 if (url->uid == 0) {
931 if (url->search_program != NULL) {
933 uri_append_query_data(urlstr, ";", url->search_program);
937 str_printfa(urlstr, "/;UID=%u", url->uid);
938 if (url->section != NULL) {
940 uri_append_path_data(urlstr, ";", url->section);
942 if (url->have_partial) {
944 if (url->partial_size == 0) {
946 url->partial_offset);
949 url->partial_offset,
950 url->partial_size);
955 if (url->uauth_access_application != NULL) {
956 if (url->uauth_expire != (time_t)-1) {
958 str_append(urlstr, iso8601_date_create(url->uauth_expire));
961 str_append(urlstr, url->uauth_access_application);
962 if (url->uauth_access_user != NULL) {
965 url->uauth_access_user);
971 const char *imap_url_create(const struct imap_url *url)
980 if (url->userid != NULL || url->auth_type != NULL) {
981 if (url->userid != NULL)
982 uri_append_user_data(urlstr, ";:", url->userid);
983 if (url->auth_type != NULL) {
985 uri_append_user_data(urlstr, ";:", url->auth_type);
991 uri_append_host(urlstr, &url->host);
992 uri_append_port(urlstr, url->port);
998 if (url->mailbox != NULL)
999 imap_url_append_mailbox(url, urlstr);