Ticket #18578: patch-mgzip.c.diff

File patch-mgzip.c.diff, 1.5 KB (added by juno@…, 15 years ago)
  • mgzip.c

    old new  
    3737/* -------------------------------------------------------- */
    3838
    3939/* gzip flag byte needs bit 0x04 set for extra field present */
    40 char gz_header[] = { 0x1f, 0x8b, 0x08, 0x04,  /* stolen from an existing .gz file */
     40char mgzip_gz_header[] = { 0x1f, 0x8b, 0x08, 0x04,  /* stolen from an existing .gz file */
    4141                       0x00, 0x00, 0x00, 0x00,
    4242                       0x00, 0x03, 0x04, 0x00 };  /* modified for a 4 byte extra field */
    4343                     
     
    219219                crc = crc32(crc, gzip_in_buffer, length);
    220220
    221221                /* write length of entire wadge to output queue */
    222                 outlength = s.total_out + sizeof(gz_header) + sizeof(outlength) + sizeof(crc) + sizeof(length);
     222                outlength = s.total_out + sizeof(mgzip_gz_header) + sizeof(outlength) + sizeof(crc) + sizeof(length);
    223223
    224224#ifdef DEBUG
    225225fprintf(stderr, "worker %d: sending on %d bytes.\n", worker_number, outlength);
     
    229229                /* gzip_writer_thread will be reading it natively.                        */
    230230                enqueue(outq, &outlength, sizeof(outlength), Q_ALL_OR_NOTHING | Q_BLOCK);
    231231                /* write valid gzip format file to output queue */
    232                 enqueue(outq, gz_header, sizeof(gz_header), Q_ALL_OR_NOTHING | Q_BLOCK);
     232                enqueue(outq, mgzip_gz_header, sizeof(mgzip_gz_header), Q_ALL_OR_NOTHING | Q_BLOCK);
    233233                outlength |= 0x7d000000;  /* mgzip magic byte */
    234234#ifdef WORDS_BIGENDIAN
    235235                longswap(&outlength);