~ubuntu-branches/ubuntu/saucy/curl/saucy-201307251546

« back to all changes in this revision

Viewing changes to lib/imap.c

  • Committer: Package Import Robot
  • Author(s): Alessandro Ghedini
  • Date: 2012-03-23 16:24:51 UTC
  • mto: (3.6.1 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 59.
  • Revision ID: package-import@ubuntu.com-20120323162451-z4gstlabjkgnrh7h
Tags: upstream-7.25.0
ImportĀ upstreamĀ versionĀ 7.25.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
9
9
 *
10
10
 * This software is licensed as described in the file COPYING, which
11
11
 * you should have received as part of this distribution. The terms
78
78
#include "url.h"
79
79
#include "rawstr.h"
80
80
#include "strtoofft.h"
81
 
#include "http_proxy.h"
82
81
 
83
82
#define _MPRINTF_REPLACE /* use our functions only */
84
83
#include <curl/mprintf.h>
721
720
  pp->endofresp = imap_endofresp;
722
721
  pp->conn = conn;
723
722
 
724
 
  if(conn->bits.tunnel_proxy && conn->bits.httpproxy) {
725
 
    /* for IMAP over HTTP proxy */
726
 
    struct HTTP http_proxy;
727
 
    struct FTP *imap_save;
728
 
 
729
 
    /* BLOCKING */
730
 
    /* We want "seamless" IMAP operations through HTTP proxy tunnel */
731
 
 
732
 
    /* Curl_proxyCONNECT is based on a pointer to a struct HTTP at the member
733
 
     * conn->proto.http; we want IMAP through HTTP and we have to change the
734
 
     * member temporarily for connecting to the HTTP proxy. After
735
 
     * Curl_proxyCONNECT we have to set back the member to the original struct
736
 
     * IMAP pointer
737
 
     */
738
 
    imap_save = data->state.proto.imap;
739
 
    memset(&http_proxy, 0, sizeof(http_proxy));
740
 
    data->state.proto.http = &http_proxy;
741
 
 
742
 
    result = Curl_proxyCONNECT(conn, FIRSTSOCKET,
743
 
                               conn->host.name, conn->remote_port);
744
 
 
745
 
    data->state.proto.imap = imap_save;
746
 
 
747
 
    if(CURLE_OK != result)
748
 
      return result;
749
 
  }
750
 
 
751
723
  if((conn->handler->flags & PROTOPT_SSL) &&
752
724
     data->state.used_interface != Curl_if_multi) {
753
725
    /* BLOCKING */