Branch: Tag:

2015-11-02

2015-11-02 19:44:48 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Revert "We can just use Gz.compress and Gz.uncompress as we are not streaming."

This reverts commit e4ce863fc0554af603453bf980f321ff21584976.

Unfortunately we are streaming...

COMPRESSION_deflate now interoperates again.

703:    switch(compression_algorithm) {    case COMPRESSION_deflate:   #if constant(Gz) -  read_state->compress = Gz.uncompress; -  write_state->compress = Gz.compress; +  // FIXME: RFC 5246 6.2.2: +  // If the decompression function encounters a TLSCompressed.fragment +  // that would decompress to a length in excess of 2^14 bytes, it MUST +  // report a fatal decompression failure error. +  read_state->compress = Gz.inflate()->inflate; +  write_state->compress = +  class(function(string, int:string) _deflate) { +  string deflate(string s) { +  // RFC 3749 2: +  // All data that was submitted for compression MUST be +  // included in the compressed output, with no data +  // retained to be included in a later output payload. +  // Flushing ensures that each compressed packet payload +  // can be decompressed completely. +  return _deflate(s, Gz.SYNC_FLUSH); +  } +  }(Gz.deflate()->deflate)->deflate;   #endif    break;    }