~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to src/url.cc

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2011-01-21 18:43:56 UTC
  • mfrom: (1.4.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20110121184356-4zn7gwuzws6lpnuc
Tags: 3.1.10-1
* New upstream release (Closes: #609881)
  - Removed patches integrated upstream
    + 16-CVE-2010-3072
    + 17-CVE-2010-2951
  - Fixes TCP DNS lookups failure on IPv6-disabled systems (Closes: #607379)
  - Fixes HTTPS not working if IPv6 is disabled (Closes: #594713)

* debian/rules
  - Enable ZPH feature (Closes: #597687)

* debian/squid3.ufw.profile
  - Added UFW profile, thanks to Alessio Treglia (Closes: #605088)

* debian/control
  - Added versioned dependency on squid-langpack

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include "URLScheme.h"
39
39
#include "rfc1738.h"
40
40
 
 
41
static HttpRequest *urlParseFinish(const HttpRequestMethod& method,
 
42
                                   const protocol_t protocol,
 
43
                                   const char *const urlpath,
 
44
                                   const char *const host,
 
45
                                   const char *const login,
 
46
                                   const int port,
 
47
                                   HttpRequest *request);
41
48
static HttpRequest *urnParse(const HttpRequestMethod& method, char *urn);
42
49
static const char valid_hostname_chars_u[] =
43
50
    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
222
229
            if (sscanf(url, "%[^:]:%d", host, &port) < 1)
223
230
                return NULL;
224
231
 
 
232
    } else if ((method == METHOD_OPTIONS || method == METHOD_TRACE) &&
 
233
               strcmp(url, "*") == 0) {
 
234
        protocol = PROTO_HTTP;
 
235
        port = urlDefaultPort(protocol);
 
236
        return urlParseFinish(method, protocol, url, host, login, port, request);
225
237
    } else if (!strncmp(url, "urn:", 4)) {
226
238
        return urnParse(method, url);
227
239
    } else {
402
414
        }
403
415
    }
404
416
 
 
417
    return urlParseFinish(method, protocol, urlpath, host, login, port, request);
 
418
}
 
419
 
 
420
/**
 
421
 * Update request with parsed URI data.  If the request arg is
 
422
 * non-NULL, put parsed values there instead of allocating a new
 
423
 * HttpRequest.
 
424
 */
 
425
static HttpRequest *
 
426
urlParseFinish(const HttpRequestMethod& method,
 
427
               const protocol_t protocol,
 
428
               const char *const urlpath,
 
429
               const char *const host,
 
430
               const char *const login,
 
431
               const int port,
 
432
               HttpRequest *request)
 
433
{
405
434
    if (NULL == request)
406
435
        request = new HttpRequest(method, protocol, urlpath);
407
436
    else {
767
796
    if (r->method == METHOD_CONNECT)
768
797
        return 1;
769
798
 
770
 
    if (r->method == METHOD_TRACE)
771
 
        return 1;
 
799
    // we support OPTIONS and TRACE directed at us (with a 501 reply, for now)
 
800
    // we also support forwarding OPTIONS and TRACE, except for the *-URI ones
 
801
    if (r->method == METHOD_OPTIONS || r->method == METHOD_TRACE)
 
802
        return (r->header.getInt64(HDR_MAX_FORWARDS) == 0 || r->urlpath != "*");
772
803
 
773
804
    if (r->method == METHOD_PURGE)
774
805
        return 1;