@@ 5299-5336 (lines=38) @@ | ||
5296 | s.status = NAME_STATE; |
|
5297 | } |
|
5298 | } |
|
5299 | if (s.status === NAME_STATE) { |
|
5300 | if (s.gzhead.name/* != Z_NULL*/) { |
|
5301 | beg = s.pending; /* start of bytes to update crc */ |
|
5302 | //int val; |
|
5303 | ||
5304 | do { |
|
5305 | if (s.pending === s.pending_buf_size) { |
|
5306 | if (s.gzhead.hcrc && s.pending > beg) { |
|
5307 | strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); |
|
5308 | } |
|
5309 | flush_pending(strm); |
|
5310 | beg = s.pending; |
|
5311 | if (s.pending === s.pending_buf_size) { |
|
5312 | val = 1; |
|
5313 | break; |
|
5314 | } |
|
5315 | } |
|
5316 | // JS specific: little magic to add zero terminator to end of string |
|
5317 | if (s.gzindex < s.gzhead.name.length) { |
|
5318 | val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff; |
|
5319 | } else { |
|
5320 | val = 0; |
|
5321 | } |
|
5322 | put_byte(s, val); |
|
5323 | } while (val !== 0); |
|
5324 | ||
5325 | if (s.gzhead.hcrc && s.pending > beg){ |
|
5326 | strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); |
|
5327 | } |
|
5328 | if (val === 0) { |
|
5329 | s.gzindex = 0; |
|
5330 | s.status = COMMENT_STATE; |
|
5331 | } |
|
5332 | } |
|
5333 | else { |
|
5334 | s.status = COMMENT_STATE; |
|
5335 | } |
|
5336 | } |
|
5337 | if (s.status === COMMENT_STATE) { |
|
5338 | if (s.gzhead.comment/* != Z_NULL*/) { |
|
5339 | beg = s.pending; /* start of bytes to update crc */ |
|
@@ 5337-5373 (lines=37) @@ | ||
5334 | s.status = COMMENT_STATE; |
|
5335 | } |
|
5336 | } |
|
5337 | if (s.status === COMMENT_STATE) { |
|
5338 | if (s.gzhead.comment/* != Z_NULL*/) { |
|
5339 | beg = s.pending; /* start of bytes to update crc */ |
|
5340 | //int val; |
|
5341 | ||
5342 | do { |
|
5343 | if (s.pending === s.pending_buf_size) { |
|
5344 | if (s.gzhead.hcrc && s.pending > beg) { |
|
5345 | strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); |
|
5346 | } |
|
5347 | flush_pending(strm); |
|
5348 | beg = s.pending; |
|
5349 | if (s.pending === s.pending_buf_size) { |
|
5350 | val = 1; |
|
5351 | break; |
|
5352 | } |
|
5353 | } |
|
5354 | // JS specific: little magic to add zero terminator to end of string |
|
5355 | if (s.gzindex < s.gzhead.comment.length) { |
|
5356 | val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff; |
|
5357 | } else { |
|
5358 | val = 0; |
|
5359 | } |
|
5360 | put_byte(s, val); |
|
5361 | } while (val !== 0); |
|
5362 | ||
5363 | if (s.gzhead.hcrc && s.pending > beg) { |
|
5364 | strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg); |
|
5365 | } |
|
5366 | if (val === 0) { |
|
5367 | s.status = HCRC_STATE; |
|
5368 | } |
|
5369 | } |
|
5370 | else { |
|
5371 | s.status = HCRC_STATE; |
|
5372 | } |
|
5373 | } |
|
5374 | if (s.status === HCRC_STATE) { |
|
5375 | if (s.gzhead.hcrc) { |
|
5376 | if (s.pending + 2 > s.pending_buf_size) { |