Ticket #1027: lighttpd-1.4.19-compress-mkdir.patch

File lighttpd-1.4.19-compress-mkdir.patch, 1.1 kB (added by spillgroup, 5 months ago)

Optimization patch for 1.4.19

  • lighttpd-1.4.19/src/mod_compress.c

    old new  
    411411 
    412412        buffer_append_string_buffer(p->ofn, sce->etag); 
    413413 
    414         if (-1 == mkdir_for_file(p->ofn->ptr)) { 
    415                 log_error_write(srv, __FILE__, __LINE__, "sb", "couldn't create directory for file", p->ofn); 
    416                 return -1; 
    417         } 
    418  
    419414        if (-1 == (ofd = open(p->ofn->ptr, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0600))) { 
    420415                if (errno == EEXIST) { 
    421416                        /* cache-entry exists */ 
     
    427422                        return 0; 
    428423                } 
    429424 
    430                 log_error_write(srv, __FILE__, __LINE__, "sbss", "creating cachefile", p->ofn, "failed", strerror(errno)); 
     425                if (-1 == mkdir_for_file(p->ofn->ptr)) { 
     426                        log_error_write(srv, __FILE__, __LINE__, "sb", "couldn't create directory for file", p->ofn); 
     427                        return -1; 
     428                } 
    431429 
    432                 return -1; 
     430                if (-1 == (ofd = open(p->ofn->ptr, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0600))) { 
     431                        log_error_write(srv, __FILE__, __LINE__, "sbss", "creating cachefile", p->ofn, "failed", strerror(errno)); 
     432                        return -1; 
     433                } 
    433434        } 
    434435#if 0 
    435436        log_error_write(srv, __FILE__, __LINE__, "bs", p->ofn, "compress-cache miss");