~ubuntu-branches/ubuntu/utopic/squid3/utopic-proposed

« back to all changes in this revision

Viewing changes to src/HttpHdrContRange.cc

  • Committer: Package Import Robot
  • Author(s): Yolanda Robla
  • Date: 2013-07-10 17:12:42 UTC
  • mfrom: (21.2.18 sid)
  • Revision ID: package-import@ubuntu.com-20130710171242-2i9v941ikbpnjyqk
Tags: 3.3.4-1ubuntu1
* Merge from Debian unstable (LP: #1199883).  Remaining changes:
  + debian/control:
    - Update maintainer.
    - Suggests apparmor (>= 2.3)
    - Depends on ssl-cert ((>= 1.0-11ubuntu1), autopkgtests
  + debian/squid3.upstart
    - Move ulimit command to script section so that it applies
      to the started squid daemon. Thanks to Timur Irmatov (LP: 986159)
    - Work around squid not handling SIGHUP by adding respawn to
      upstart job. (LP: 978356)
  + debian/NEWS.Debian: Rename NEWS.debian, add note regarding squid3
    transition in 12.04 (LP: 924739)
  + debian/rules
    - Re-enable all hardening options lost in the squid->squid3
      transition (LP: 986314)
  + squid3.resolvconf, debian/squid3.postinst, debian/squid3.postrm,
    debian/squid3.preinst, debian/squid3.prerm:
    - Convert init script to upstart
  + debian/patches/99-ubuntu-ssl-cert-snakeoil:
    - Use snakeoil certificates.
  + debian/logrotate
    - Use sar-reports rather than sarg-maint. (LP: 26616)
  + debian/patches/90-cf.data.ubuntu.dpatch:
    - Add an example refresh pattern for debs.
      (foundations-lucid-local-report spec)
  + Add disabled by default AppArmor profile (LP: 497790)
    - debian/squid3.upstart: load profile in pre-start stanza
    - add debian/usr.sbin.squid3 profile
    - debian/rules:
      + install debian/usr.sbin.squid3, etc/apparmor.d/force-complain and
        etc/apparmor.d/disable into $(INSTALLDIR)
      + use dh_apparmor
    - debian/squid3.install: install etc/apparmor.d/disable, force-complain
      and usr.sbin.squid3
    - debian/squid3.preinst: disable profile on clean install or upgrades
      from earlier than when we shipped the profile
  + debian/tests:
    - Add autopkgtests.

* Dropped:
  - debian/patches: dropped patches, superseded by new release:
    + 98-CVE-2012-5643.patch
    + 99-lp1117517_r12473.patch
  - debian/rules: fix FTBFS, removed --with-cppunit-basedir flag,
    included in Debian.
  - debian/control: Dropped transitional packages from squid, no
    longer required.

* Refreshed patches:
  - 01-cf.data.debian.patch
  - 02-makefile-defaults.patch
  - 15-cachemgr-default-config.patch

* debian/tests/test-squid.py: fixed case problem with ftp test

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
/*
3
 
 * $Id$
4
 
 *
5
3
 * DEBUG: section 68    HTTP Content-Range Header
6
4
 * AUTHOR: Alex Rousskov
7
5
 *
34
32
 */
35
33
 
36
34
#include "squid.h"
 
35
#include "Debug.h"
 
36
#include "enums.h"
37
37
#include "HttpHdrContRange.h"
 
38
#include "HttpHeaderTools.h"
 
39
#include "Mem.h"
38
40
 
39
41
/*
40
42
 *    Currently only byte ranges are supported
48
50
 *    entity-length        = 1*DIGIT
49
51
 */
50
52
 
51
 
 
52
53
/* local constants */
53
54
#define range_spec_unknown (-1)
54
55
 
90
91
        return 0;
91
92
    }
92
93
 
93
 
    p++;
 
94
    ++p;
94
95
 
95
96
    /* do we have last-pos ? */
96
97
    if (p - field >= flen) {
129
130
    if (!known_spec(spec->offset) || !known_spec(spec->length))
130
131
        packerPrintf(p, "*");
131
132
    else
132
 
        packerPrintf(p, "bytes %"PRId64"-%"PRId64,
 
133
        packerPrintf(p, "bytes %" PRId64 "-%" PRId64,
133
134
                     spec->offset, spec->offset + spec->length - 1);
134
135
}
135
136
 
182
183
    else if (!httpHdrRangeRespSpecParseInit(&range->spec, str, p - str))
183
184
        return 0;
184
185
 
185
 
    p++;
 
186
    ++p;
186
187
 
187
188
    if (*p == '*')
188
189
        range->elength = range_spec_unknown;
233
234
    if (!known_spec(range->elength))
234
235
        packerPrintf(p, "/*");
235
236
    else
236
 
        packerPrintf(p, "/%"PRId64, range->elength);
 
237
        packerPrintf(p, "/%" PRId64, range->elength);
237
238
}
238
239
 
239
240
void