]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap-urlauth: Added API for using the fetch interface with an already parsed...
authorStephan Bosch <stephan@rename-it.nl>
Thu, 30 May 2013 15:04:58 +0000 (18:04 +0300)
committerStephan Bosch <stephan@rename-it.nl>
Thu, 30 May 2013 15:04:58 +0000 (18:04 +0300)
src/lib-imap-urlauth/imap-urlauth-fetch.c
src/lib-imap-urlauth/imap-urlauth-fetch.h

index b0836bd4689b57ee9e80e6982e2091763ec9f2ed..0af33f65fcd2f78bf9c12ab6f341c1ec5b2d7211 100644 (file)
@@ -348,7 +348,6 @@ int imap_urlauth_fetch_url(struct imap_urlauth_fetch *ufetch, const char *url,
        struct mail_user *mail_user = uctx->user;
        struct imap_url *imap_url;
        const char *error, *errormsg;
-       int ret = 0;
 
        /* parse the url */
        if (imap_url_parse(url, NULL, url_parse_flags, &imap_url, &error) < 0) {
@@ -363,6 +362,18 @@ int imap_urlauth_fetch_url(struct imap_urlauth_fetch *ufetch, const char *url,
                return 1;
        }
 
+       return imap_urlauth_fetch_url_parsed(ufetch, url, imap_url, url_flags);
+}
+
+int imap_urlauth_fetch_url_parsed(struct imap_urlauth_fetch *ufetch,
+                          const char *url, struct imap_url *imap_url,
+                          enum imap_urlauth_fetch_flags url_flags)
+{
+       struct imap_urlauth_context *uctx = ufetch->uctx;
+       struct mail_user *mail_user = uctx->user;
+       const char *error, *errormsg;
+       int ret = 0;
+
        ufetch->failed = FALSE;
        ufetch->pending_requests++;
 
index 8d39381639fb3b1d8e43629c0ba7122524c404b1..116a477fcf8d67dd4c1151d41fffe5806ff2fffc 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef IMAP_URLAUTH_FETCH_H
 #define IMAP_URLAUTH_FETCH_H
 
+struct imap_url;
 struct imap_urlauth_context;
 struct imap_urlauth_fetch;
 
@@ -45,6 +46,9 @@ void imap_urlauth_fetch_deinit(struct imap_urlauth_fetch **ufetch);
 
 int imap_urlauth_fetch_url(struct imap_urlauth_fetch *ufetch, const char *url,
                           enum imap_urlauth_fetch_flags url_flags);
+int imap_urlauth_fetch_url_parsed(struct imap_urlauth_fetch *ufetch,
+                          const char *url, struct imap_url *imap_url,
+                          enum imap_urlauth_fetch_flags url_flags);
 
 bool imap_urlauth_fetch_continue(struct imap_urlauth_fetch *ufetch);
 bool imap_urlauth_fetch_is_pending(struct imap_urlauth_fetch *ufetch);