~ubuntu-branches/ubuntu/jaunty/cups/jaunty-proposed

« back to all changes in this revision

Viewing changes to cups/http.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2008-07-23 08:58:57 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080723085857-snar5iirwgr0djnc
Tags: 1.3.8-1
* New upstream release: some 20 bug fixes, no new features (see
  http://www.cups.org/articles.php?L562 for details).
* Dropped patches, accepted upstream:
  - empty_option_value_crash.dpatch
  - CVE-2008-1722.dpatch
  - glibc2.8_build.dpatch
  - HostNameLookups_values.dpatch
* manpage-typos.dpatch: Most of this got applied to 1.3.8. The ".Sh" ->
  ".SS" fix only got applied to trunk, so backport these remaining ones.
* manpage-translations.dpatch: Update to new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * "$Id: http.c 7222 2008-01-16 22:20:33Z mike $"
 
2
 * "$Id: http.c 7721 2008-07-11 22:48:49Z mike $"
3
3
 *
4
4
 *   HTTP routines for the Common UNIX Printing System (CUPS).
5
5
 *
293
293
httpClose(http_t *http)                 /* I - HTTP connection */
294
294
{
295
295
#ifdef HAVE_GSSAPI
296
 
  OM_uint32     minor_status,           /* Minor status code */
297
 
                major_status;           /* Major status code */
 
296
  OM_uint32     minor_status;           /* Minor status code */
298
297
#endif /* HAVE_GSSAPI */
299
298
 
300
299
 
321
320
 
322
321
#ifdef HAVE_GSSAPI
323
322
  if (http->gssctx != GSS_C_NO_CONTEXT)
324
 
    major_status = gss_delete_sec_context(&minor_status, &http->gssctx,
325
 
                                          GSS_C_NO_BUFFER);
 
323
    gss_delete_sec_context(&minor_status, &http->gssctx, GSS_C_NO_BUFFER);
326
324
 
327
325
  if (http->gssname != GSS_C_NO_NAME)
328
 
    major_status = gss_release_name(&minor_status, &http->gssname);
 
326
    gss_release_name(&minor_status, &http->gssname);
329
327
#endif /* HAVE_GSSAPI */
330
328
 
331
329
#ifdef HAVE_AUTHORIZATION_H
2522
2520
          const char   *uri)    /* I - URI */
2523
2521
{
2524
2522
  int           i;              /* Looping var */
2525
 
  char          *ptr,           /* Pointer in buffer */
2526
 
                buf[1024];      /* Encoded URI buffer */
 
2523
  char          buf[1024];      /* Encoded URI buffer */
2527
2524
  static const char * const codes[] =
2528
2525
                {               /* Request code strings */
2529
2526
                  NULL,
2540
2537
                  "TRACE",
2541
2538
                  "CLOSE"
2542
2539
                };
2543
 
  static const char hex[] = "0123456789ABCDEF";
2544
 
                                /* Hex digits */
2545
2540
 
2546
2541
 
2547
2542
  DEBUG_printf(("http_send(http=%p, request=HTTP_%s, uri=\"%s\")\n",
2561
2556
  * Encode the URI as needed...
2562
2557
  */
2563
2558
 
2564
 
  for (ptr = buf; *uri != '\0' && ptr < (buf + sizeof(buf) - 1); uri ++)
2565
 
    if (*uri <= ' ' || *uri >= 127)
2566
 
    {
2567
 
      if (ptr < (buf + sizeof(buf) - 1))
2568
 
        *ptr ++ = '%';
2569
 
      if (ptr < (buf + sizeof(buf) - 1))
2570
 
        *ptr ++ = hex[(*uri >> 4) & 15];
2571
 
      if (ptr < (buf + sizeof(buf) - 1))
2572
 
        *ptr ++ = hex[*uri & 15];
2573
 
    }
2574
 
    else
2575
 
      *ptr ++ = *uri;
2576
 
 
2577
 
  *ptr = '\0';
 
2559
  _httpEncodeURI(buf, uri, sizeof(buf));
2578
2560
 
2579
2561
 /*
2580
2562
  * See if we had an error the last time around; if so, reconnect...
3241
3223
 
3242
3224
 
3243
3225
/*
3244
 
 * End of "$Id: http.c 7222 2008-01-16 22:20:33Z mike $".
 
3226
 * End of "$Id: http.c 7721 2008-07-11 22:48:49Z mike $".
3245
3227
 */