zlib

Tomcat with compression enabled causes error on OS X High Sierra

坚强是说给别人听的谎言 提交于 2019-12-04 10:21:15
问题 We have been using Tomcat (v7) on OS X for quite some time now and never experienced any problems. However, after updating the OS to High Sierra, the web applications do not work anymore when compression is enabled in the server.xml. Chrome constantly shows an ERR_CONTENT_DECODING_FAILED (obviously without any content displaying). When compression is switched off, everything works fine. I assume the root of the problem is Apple's upgrade of zlib in High Sierra. Everything was working fine on

Compress large file in ruby with Zlib for gzip

左心房为你撑大大i 提交于 2019-12-04 09:24:16
I have a very large file, approx. 200 million rows of data. I would like to compress it with the Zlib library, specifically using the Writer. Reading through each line one at at time seems like it would take quite a bit of time. Is there a better way to accomplish this? Here is what I have right now: require 'zlib' Zlib::GzipWriter.open('compressed_file.gz') do |gz| File.open(large_data_file).each do |line| gz.write line end gz.close end You can use IO#read to read a chunk of arbitrary length from the file. require 'zlib' Zlib::GzipWriter.open('compressed_file.gz') do |gz| File.open(large_data

Save file from a byte[] in C# NET 3.5

最后都变了- 提交于 2019-12-04 08:21:01
问题 My TCP Client receives a image within a packet.The image is compressed with zlib.The task is to decompress the image and put it on the form. I'm planning to save the compressed image in the current directory,decompress it and load the decompressed file on the form. The first problem comes with saving the file(compressed).The zlib can save it decompressed. The code below loads the compressed file and saves it after decompression. private void decompressFile(string inFile, string outFile) {

composer爆错:zlib_decode():data error

百般思念 提交于 2019-12-04 07:04:57
解决办法:先用 composer diagnose 命令检测 然后 composer self-update 更新composer版本 最后执行 composer update 或者 composer install composer 切换阿里云镜像 用起来还快 composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ 来源: oschina 链接: https://my.oschina.net/u/3911977/blog/3106312

composer 命令行composer self-update 升级安装失败,解决办法

主宰稳场 提交于 2019-12-04 07:04:48
1.使用composer self-update 自动升级时失败出现 [ErrorException] zlib_decode(): data error提示 ] 2.编辑php.ini中zlib.output_compression = On、zlib.output_compression_level = 5 3.再使用composer self-update 升级成功 解释:zlib_decode() 属于Zlib 函数 用于解压缩任何raw / gzip / zlib编码的数据 并不是网络的问题,因为download 是100% 下载完了,而是解压时zlib_decode()函数报错 (测试过禁用iPv6等并没有卵用) 回到公司直接安装,一遍成功,???还是网络的原因吗? 来源: oschina 链接: https://my.oschina.net/u/3104120/blog/1609360

Redhat 6.7 x64升级SSH到OpenSSH_7.4p1文档

让人想犯罪 __ 提交于 2019-12-04 07:03:03
导语 Redhat企业级系统的6.7版自带SSH版本为OpenSSH_5.3p1, 基于审计和安全性需求,建议将其升级到最新的OpenSSH版本,当前官网最新版本为7.4p1. 本文档将详细介绍OpenSSH升级的完整步骤。需要说明的是,升级过程中虽然涉及zlib、openssl和openssh的卸载,但是并不会导致当前的ssh远程连接会话断开,因此是可以将整个升级过程写成自动化脚本以进行自动批量部署的。 步骤 1、准备工作 1.1、下载相关软件包 OpenSSH需要依赖zlib和OpenSSL,因此需要从官网下载三者的源码包。需要注意的是:OpenSSH最新版7.4p1依赖的OpenSSL版本为1.0.2k,而不是其最新版1.1.0e(使用此版会升级失败),ZLIB可以使用最新版1.2.11。redhat6.7自带的zlib版本为1.2.3,也可不进行升级。 三者源码下载地址: http://www.zlib.net/ http://www.openssl.org/ http://www.openssh.org/ 1.2、查看系统当前软件版本 # rpm -q zlib # openssl version # ssh -V 1.3、配置本地yum源 因安装相关工具和编译源码需要先安装部分软件包,因此需要先配置好本地yum源(如有远程yum源更好),配置方法如下: A

Using zlib filter with a socket pair

断了今生、忘了曾经 提交于 2019-12-04 06:17:53
For some reason, the zlib.deflate filter doesn't seem to be working with socket pairs generated by stream_socket_pair() . All that can be read from the second socket is the two-byte zlib header, and everything after that is NULL. Example: <?php list($in, $out) = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP); $params = array('level' => 6, 'window' => 15, 'memory' => 9); stream_filter_append($in, 'zlib.deflate', STREAM_FILTER_WRITE, $params); stream_set_blocking($in, 0); stream_set_blocking($out, 0); fwrite($in, 'Some big long string.'); $compressed = fread($out, 1024

Linux安装Git环境

徘徊边缘 提交于 2019-12-04 06:16:42
1.新建下载目录 mkdir /data/soft/phpsoft/git 2.下载git wget https://github.com/git/git/archive/v2.22.0.tar.gz 3.解压 tar v2.22.0.tar.gz 3.安装依赖 yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker 4.进入目录cd git-2.22.0 5.编译 make prefix=/data/install/git all 6.安装 make prefix=/data/install/git install 7.修改环境变量 vim /etc/profile 增加PATH=$PATH:/data/install/git/bin 8.刷新配置 source /etc/profile 9.查看版本 git --version 来源: https://my.oschina.net/ives/blog/3128376

Unzip buffer with Python?

别来无恙 提交于 2019-12-04 06:12:11
I have a buffer of bytes read from a library call and I would like to unzip the content which is a single text file. I tried with zlib , but I get this error: >>> import zlib >>> zlib.decompress(buffer) error: Error -3 while decompressing data: incorrect header check However with ZipFile it works, but I have to use a temporary file: import zipfile f = open('foo.zip', 'wb') f.write(buffer) f.close() z = ZipFile('foo.zip') z.extractall() z.close() with open('foo.txt', 'r') as f: uncompressed_buffer = f.read() Is it possible to use zlib and how can I avoid using a temporary file? Is it possible

golang/python zlib difference

倾然丶 夕夏残阳落幕 提交于 2019-12-04 05:58:29
Debugging differences between Python's zlib and golang's zlib. Why don't the following have the same results? compress.go : package main import ( "compress/flate" "bytes" "fmt" ) func compress(source string) []byte { w, _ := flate.NewWriter(nil, 7) buf := new(bytes.Buffer) w.Reset(buf) w.Write([]byte(source)) w.Close() return buf.Bytes() } func main() { example := "foo" compressed := compress(example) fmt.Println(compressed) } compress.py : from __future__ import print_function import zlib def compress(source): # golang zlib strips header + checksum compressor = zlib.compressobj(7, zlib