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

« back to all changes in this revision

Viewing changes to lib/openldap.c

  • Committer: Bazaar Package Importer
  • Author(s): Ramakrishnan Muthukrishnan
  • Date: 2010-10-18 11:13:17 UTC
  • mto: (3.6.1 experimental) (1.3.1)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20101018111317-9rkas34ecwtq0upn
Tags: upstream-7.21.2
ImportĀ upstreamĀ versionĀ 7.21.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
  li = calloc(1, sizeof(ldapconninfo));
166
166
  li->proto = proto;
167
167
  conn->proto.generic = li;
 
168
  conn->bits.close = FALSE;
168
169
  /* TODO:
169
170
   * - provide option to choose SASL Binds instead of Simple
170
171
   */
198
199
 
199
200
  ldap_set_option(li->ld, LDAP_OPT_PROTOCOL_VERSION, &proto);
200
201
 
 
202
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_PROXY)
 
203
  if(conn->bits.tunnel_proxy && conn->bits.httpproxy) {
 
204
    /* for LDAP over HTTP proxy */
 
205
    struct HTTP http_proxy;
 
206
    ldapconninfo *li_save;
 
207
    CURLcode result;
 
208
 
 
209
    /* BLOCKING */
 
210
    /* We want "seamless" LDAP operations through HTTP proxy tunnel */
 
211
 
 
212
    /* Curl_proxyCONNECT is based on a pointer to a struct HTTP at the member
 
213
     * conn->proto.http; we want LDAP through HTTP and we have to change the
 
214
     * member temporarily for connecting to the HTTP proxy. After
 
215
     * Curl_proxyCONNECT we have to set back the member to the original struct
 
216
     * LDAP pointer
 
217
     */
 
218
    li_save = data->state.proto.generic;
 
219
    memset(&http_proxy, 0, sizeof(http_proxy));
 
220
    data->state.proto.http = &http_proxy;
 
221
    result = Curl_proxyCONNECT(conn, FIRSTSOCKET,
 
222
                               conn->host.name, conn->remote_port);
 
223
 
 
224
    data->state.proto.generic = li_save;
 
225
 
 
226
    if(CURLE_OK != result)
 
227
      return result;
 
228
  }
 
229
#endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_PROXY */
 
230
 
201
231
#ifdef USE_SSL
202
232
  if (conn->protocol & PROT_SSL) {
203
233
    CURLcode res;