~ubuntu-branches/debian/stretch/haproxy/stretch

« back to all changes in this revision

Viewing changes to src/compression.c

  • Committer: Package Import Robot
  • Author(s): Vincent Bernat
  • Date: 2015-05-02 16:38:28 UTC
  • mfrom: (1.3.13)
  • Revision ID: package-import@ubuntu.com-20150502163828-lph2toctaqrw41x5
Tags: 1.5.12-1
* New upstream stable release including the following fixes:
  - BUG/MAJOR: http: don't read past buffer's end in http_replace_value
  - BUG/MAJOR: http: prevent risk of reading past end with balance
               url_param
  - BUG/MEDIUM: Do not consider an agent check as failed on L7 error
  - BUG/MEDIUM: patern: some entries are not deleted with case
                insensitive match
  - BUG/MEDIUM: buffer: one byte miss in buffer free space check
  - BUG/MEDIUM: http: thefunction "(req|res)-replace-value" doesn't
                respect the HTTP syntax
  - BUG/MEDIUM: peers: correctly configure the client timeout
  - BUG/MEDIUM: http: hdr_cnt would not count any header when called
                without name
  - BUG/MEDIUM: listener: don't report an error when resuming unbound
                listeners
  - BUG/MEDIUM: init: don't limit cpu-map to the first 32 processes only
  - BUG/MEDIUM: stream-int: always reset si->ops when si->end is
                nullified
  - BUG/MEDIUM: http: remove content-length from chunked messages
  - BUG/MEDIUM: http: do not restrict parsing of transfer-encoding to
                HTTP/1.1
  - BUG/MEDIUM: http: incorrect transfer-coding in the request is a bad
                request
  - BUG/MEDIUM: http: remove content-length form responses with bad
                transfer-encoding
  - BUG/MEDIUM: http: wait for the exact amount of body bytes in
                wait_for_request_body

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
{
131
131
        int left;
132
132
 
133
 
        /* not enough space */
134
 
        if (in->size - buffer_len(in) < 40)
135
 
            return -1;
 
133
        /* output stream requires at least 10 bytes for the gzip header, plus
 
134
         * at least 8 bytes for the gzip trailer (crc+len), plus a possible
 
135
         * plus at most 5 bytes per 32kB block and 2 bytes to close the stream.
 
136
         */
 
137
        if (in->size - buffer_len(in) < 20 + 5 * ((in->i + 32767) >> 15))
 
138
                return -1;
136
139
 
137
140
        /* We start by copying the current buffer's pending outgoing data into
138
141
         * a new temporary buffer that we initialize with a new empty chunk.