~yolanda.robla/ubuntu/saucy/squid3/fix-squid3-startstop

« back to all changes in this revision

Viewing changes to src/Server.cc

  • Committer: Package Import Robot
  • Author(s): Stefan Bader
  • Date: 2012-06-22 14:18:00 UTC
  • mfrom: (21.2.12 sid)
  • Revision ID: package-import@ubuntu.com-20120622141800-c0e3p4wjxekxp1qh
Tags: 3.1.20-1ubuntu1
* Merge from Debian testing (LP: #1016560).  Remaining changes:
  + debian/control:
    - Update maintainer.
    - Suggests apparmor (>= 2.3)
    - Depends on ssl-cert ((>= 1.0-11ubuntu1)
    - Add transitional dummy packages
  + 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

Show diffs side-by-side

added added

removed removed

Lines of Context:
721
721
    if (!contentSize)
722
722
        return; // XXX: bytesWanted asserts on zero-size ranges
723
723
 
724
 
    // XXX: entry->bytesWanted returns contentSize-1 if entry can accept data.
725
 
    // We have to add 1 to avoid suspending forever.
726
 
    const size_t bytesWanted = entry->bytesWanted(Range<size_t>(0, contentSize));
727
 
    const size_t spaceAvailable = bytesWanted >  0 ? (bytesWanted + 1) : 0;
 
724
    const size_t spaceAvailable = entry->bytesWanted(Range<size_t>(0, contentSize));
728
725
 
729
726
    if (spaceAvailable < contentSize ) {
730
727
        // No or partial body data consuming
734
731
        entry->deferProducer(call);
735
732
    }
736
733
 
737
 
    // XXX: bytesWanted API does not allow us to write just one byte!
738
 
    if (!spaceAvailable && contentSize > 1)  {
 
734
    if (!spaceAvailable)  {
739
735
        debugs(11, 5, HERE << "NOT storing " << contentSize << " bytes of adapted " <<
740
736
               "response body at offset " << adaptedBodySource->consumedSize());
741
737
        return;