Comparison

plugins/mod_compression.lua @ 3202:1a8a5b89a5ad

Merge 0.7->trunk
author Matthew Wild <mwild1@gmail.com>
date Wed, 09 Jun 2010 01:11:12 +0100
parent 3148:a83a995fe5db
parent 3200:fd2389a240a2
child 3223:ee2dabe699c9
comparison
equal deleted inserted replaced
3197:f1db45e89317 3202:1a8a5b89a5ad
94 end 94 end
95 95
96 -- setup compression for a stream 96 -- setup compression for a stream
97 local function setup_compression(session, deflate_stream) 97 local function setup_compression(session, deflate_stream)
98 add_filter(session, "bytes/out", function(t) 98 add_filter(session, "bytes/out", function(t)
99 session.log(t)
100 local status, compressed, eof = pcall(deflate_stream, tostring(t), 'sync'); 99 local status, compressed, eof = pcall(deflate_stream, tostring(t), 'sync');
101 if status == false then 100 if status == false then
102 session:close({ 101 session:close({
103 condition = "undefined-condition"; 102 condition = "undefined-condition";
104 text = compressed; 103 text = compressed;