Changeset 1604

Show
Ignore:
Timestamp:
02/04/2007 09:42:53 PM (20 months ago)
Author:
jan
Message:

increment c->offset only once

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/mod_deflate.c

    r1544 r1604  
    784784         
    785785        if (abs_offset > sce->st.st_size) { 
    786                 log_error_write(srv, __FILE__, __LINE__, "sb",  
    787                                 "file was shrinked:", c->file.name); 
     786                ERROR("file '%s' was shrinked: was %lld, is %lld (%lld, %lld)",  
     787                                BUF_STR(c->file.name), abs_offset, sce->st.st_size, 
     788                                c->file.start, c->offset); 
    788789                 
    789790                return -1; 
     
    909910        } 
    910911 
    911         c->offset += toSend; 
    912         if (c->offset == c->file.length) { 
    913                 /* we don't need the mmaping anymore */ 
    914                 if (c->file.mmap.start != MAP_FAILED) { 
    915                         munmap(c->file.mmap.start, c->file.mmap.length); 
    916                         c->file.mmap.start = MAP_FAILED; 
    917                 } 
    918         } 
    919  
    920912        return toSend; 
    921913} 
     
    10151007                out += we_want; 
    10161008                max -= we_want; 
     1009         
     1010                if (c->type == FILE_CHUNK &&  
     1011                    c->offset == c->file.length && 
     1012                    c->file.mmap.start != MAP_FAILED) { 
     1013                        /* we don't need the mmaping anymore */ 
     1014                        munmap(c->file.mmap.start, c->file.mmap.length); 
     1015                        c->file.mmap.start = MAP_FAILED; 
     1016                } 
     1017 
    10171018                if (we_have == we_want) { 
    10181019                        /* chunk finished */ 
     
    10341035        /* check if we finished compressing all the content. */ 
    10351036        end = (hctx->in->is_closed && hctx->in->bytes_in == hctx->in->bytes_out); 
     1037 
     1038        if (p->conf.debug) { 
     1039                TRACE("end: %d - %lld - %lld", hctx->in->is_closed, hctx->in->bytes_in, hctx->in->bytes_out); 
     1040        } 
    10361041 
    10371042        /* flush the output buffer to make room for more data. */