How to use the rs4.compressors.GZipDecompressor function in rs4

To help you get started, we’ve selected a few rs4 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hansroh / aquests / aquests / protocols / grpc / message.py View on Github external
def decode_message (msg, iscompressed):	
	if iscompressed:
		decompressor = compressors.GZipDecompressor ()
		msg = decompressor.decompress (msg)	+ decompressor.flush ()
	return msg
github hansroh / aquests / aquests / protocols / http / response.py View on Github external
def init_buffer (self):
		self.set_max_age ()
		ct = self.get_header ("content-type", "")
		if ct.startswith ('application/grpc'):
			self.p, self.u = buffers.getfakeparser (grpc_buffer, cache = self.max_age)
		elif ct.startswith ('text/xml') and self.request.xmlrpc_serialized ():
			self.p = self.u = buffers.cachable_xmlrpc_buffer (self.max_age)
			self.is_xmlrpc_return = True
		elif ct.startswith ('application/json-rpc'):
			self.p = self.u = buffers.cachable_jsonrpc_buffer (self.max_age)				
		else:			
			self.p, self.u = buffers.getfakeparser (buffers.bytes_buffer, cache = self.max_age)
			
		if self.get_header ("Content-Encoding") == "gzip":			
			self.decompressor = compressors.GZipDecompressor ()