MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

use non compat zng header for server

+9 -8
+9 -8
src/modules/server.c
··· 5 5 #include <string.h> 6 6 #include <signal.h> 7 7 #include <uv.h> 8 + #include <string.h> 8 9 9 - #include <zlib.h> 10 + #include <zlib-ng.h> 10 11 #include <utarray.h> 11 12 12 13 #include "ant.h" ··· 573 574 } 574 575 575 576 static char* gzip_compress(const char *data, size_t data_len, size_t *compressed_len) { 576 - z_stream stream; 577 + zng_stream stream; 577 578 memset(&stream, 0, sizeof(stream)); 578 579 579 - if (deflateInit2(&stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 15 + 16, 8, Z_DEFAULT_STRATEGY) != Z_OK) { 580 + if (zng_deflateInit2(&stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, 15 + 16, 8, Z_DEFAULT_STRATEGY) != Z_OK) { 580 581 return NULL; 581 582 } 582 583 583 - size_t bound = deflateBound(&stream, data_len); 584 + size_t bound = zng_deflateBound(&stream, data_len); 584 585 char *compressed = malloc(bound); 585 586 if (!compressed) { 586 - deflateEnd(&stream); 587 + zng_deflateEnd(&stream); 587 588 return NULL; 588 589 } 589 590 ··· 592 593 stream.next_out = (Bytef *)compressed; 593 594 stream.avail_out = (uInt)bound; 594 595 595 - if (deflate(&stream, Z_FINISH) != Z_STREAM_END) { 596 + if (zng_deflate(&stream, Z_FINISH) != Z_STREAM_END) { 596 597 free(compressed); 597 - deflateEnd(&stream); 598 + zng_deflateEnd(&stream); 598 599 return NULL; 599 600 } 600 601 601 602 *compressed_len = stream.total_out; 602 - deflateEnd(&stream); 603 + zng_deflateEnd(&stream); 603 604 604 605 return compressed; 605 606 }