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

« back to all changes in this revision

Viewing changes to lib/http_negotiate.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:
5
5
 *                            | (__| |_| |  _ <| |___
6
6
 *                             \___|\___/|_| \_\_____|
7
7
 *
8
 
 * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
 
8
 * Copyright (C) 1998 - 2010, 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
277
277
    &conn->data->state.negotiate;
278
278
  char *encoded = NULL;
279
279
  size_t len;
 
280
  char *userp;
280
281
 
281
282
#ifdef HAVE_SPNEGO /* Handle SPNEGO */
282
283
  if(checkprefix("Negotiate", neg_ctx->protocol)) {
330
331
  if(len == 0)
331
332
    return CURLE_OUT_OF_MEMORY;
332
333
 
333
 
  conn->allocptr.userpwd =
334
 
    aprintf("%sAuthorization: %s %s\r\n", proxy ? "Proxy-" : "",
335
 
            neg_ctx->protocol, encoded);
 
334
  userp = aprintf("%sAuthorization: %s %s\r\n", proxy ? "Proxy-" : "",
 
335
                  neg_ctx->protocol, encoded);
 
336
 
 
337
  if(proxy)
 
338
    conn->allocptr.proxyuserpwd = userp;
 
339
  else
 
340
    conn->allocptr.userpwd = userp;
336
341
  free(encoded);
337
342
  Curl_cleanup_negotiate (conn->data);
338
 
  return (conn->allocptr.userpwd == NULL) ? CURLE_OUT_OF_MEMORY : CURLE_OK;
 
343
  return (userp == NULL) ? CURLE_OUT_OF_MEMORY : CURLE_OK;
339
344
}
340
345
 
341
346
static void cleanup(struct negotiatedata *neg_ctx)