Ticket #18578: patch-mgzip.c.diff
File patch-mgzip.c.diff, 1.5 KB (added by juno@…, 16 years ago) |
---|
-
mgzip.c
old new 37 37 /* -------------------------------------------------------- */ 38 38 39 39 /* 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 */40 char mgzip_gz_header[] = { 0x1f, 0x8b, 0x08, 0x04, /* stolen from an existing .gz file */ 41 41 0x00, 0x00, 0x00, 0x00, 42 42 0x00, 0x03, 0x04, 0x00 }; /* modified for a 4 byte extra field */ 43 43 … … 219 219 crc = crc32(crc, gzip_in_buffer, length); 220 220 221 221 /* 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); 223 223 224 224 #ifdef DEBUG 225 225 fprintf(stderr, "worker %d: sending on %d bytes.\n", worker_number, outlength); … … 229 229 /* gzip_writer_thread will be reading it natively. */ 230 230 enqueue(outq, &outlength, sizeof(outlength), Q_ALL_OR_NOTHING | Q_BLOCK); 231 231 /* 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); 233 233 outlength |= 0x7d000000; /* mgzip magic byte */ 234 234 #ifdef WORDS_BIGENDIAN 235 235 longswap(&outlength);