Lines Matching refs:compress
467 } compress; member
535 ctx->compress.state = ZSTD_createCStream(); in bio_zstd_new()
537 ctx->compress.state = ZSTD_createCStream_advanced(zstd_mem_funcs); in bio_zstd_new()
539 if (ctx->compress.state == NULL) in bio_zstd_new()
541 ZSTD_initCStream(ctx->compress.state, ZSTD_CLEVEL_DEFAULT); in bio_zstd_new()
542 ctx->compress.bufsize = ZSTD_CStreamInSize(); in bio_zstd_new()
551 ZSTD_freeCStream(ctx->compress.state); in bio_zstd_new()
567 ZSTD_freeCStream(ctx->compress.state); in bio_zstd_free()
568 OPENSSL_free(ctx->compress.outbuf.dst); in bio_zstd_free()
650 if (ctx->compress.outbuf.dst == NULL) { in bio_zstd_write()
651 ctx->compress.outbuf.dst = OPENSSL_malloc(ctx->compress.bufsize); in bio_zstd_write()
652 if (ctx->compress.outbuf.dst == NULL) { in bio_zstd_write()
656 ctx->compress.outbuf.size = ctx->compress.bufsize; in bio_zstd_write()
657 ctx->compress.outbuf.pos = 0; in bio_zstd_write()
658 ctx->compress.write_pos = 0; in bio_zstd_write()
666 while (ctx->compress.write_pos < ctx->compress.outbuf.pos) { in bio_zstd_write()
667 … ret = BIO_write(next, (unsigned char*)ctx->compress.outbuf.dst + ctx->compress.write_pos, in bio_zstd_write()
668 ctx->compress.outbuf.pos - ctx->compress.write_pos); in bio_zstd_write()
675 ctx->compress.write_pos += ret; in bio_zstd_write()
683 ctx->compress.outbuf.pos = 0; in bio_zstd_write()
684 ctx->compress.outbuf.size = ctx->compress.bufsize; in bio_zstd_write()
685 ctx->compress.write_pos = 0; in bio_zstd_write()
687 zret = ZSTD_compressStream2(ctx->compress.state, &ctx->compress.outbuf, &inBuf, ZSTD_e_end); in bio_zstd_write()
708 if (ctx->compress.outbuf.dst == NULL) in bio_zstd_flush()
713 ctx->compress.outbuf.pos = 0; in bio_zstd_flush()
714 ctx->compress.outbuf.size = ctx->compress.bufsize; in bio_zstd_flush()
715 ctx->compress.write_pos = 0; in bio_zstd_flush()
718 while (ctx->compress.write_pos < ctx->compress.outbuf.pos) { in bio_zstd_flush()
719 … ret = BIO_write(next, (unsigned char*)ctx->compress.outbuf.dst + ctx->compress.write_pos, in bio_zstd_flush()
720 ctx->compress.outbuf.pos - ctx->compress.write_pos); in bio_zstd_flush()
725 ctx->compress.write_pos += ret; in bio_zstd_flush()
729 ctx->compress.outbuf.pos = 0; in bio_zstd_flush()
730 ctx->compress.outbuf.size = ctx->compress.bufsize; in bio_zstd_flush()
731 ctx->compress.write_pos = 0; in bio_zstd_flush()
733 zret = ZSTD_flushStream(ctx->compress.state, &ctx->compress.outbuf); in bio_zstd_flush()
758 ctx->compress.write_pos = 0; in bio_zstd_ctrl()
759 ctx->compress.bufsize = 0; in bio_zstd_ctrl()
773 obs = ctx->compress.bufsize; in bio_zstd_ctrl()
796 if (obs > 0 && obs != ctx->compress.bufsize) { in bio_zstd_ctrl()
797 if (ctx->compress.outbuf.dst != NULL) { in bio_zstd_ctrl()
798 tmp = OPENSSL_realloc(ctx->compress.outbuf.dst, obs); in bio_zstd_ctrl()
801 ctx->compress.outbuf.dst = tmp; in bio_zstd_ctrl()
803 ctx->compress.bufsize = obs; in bio_zstd_ctrl()
815 if (ctx->compress.outbuf.pos < ctx->compress.outbuf.size) in bio_zstd_ctrl()