Changeset 5257

Show
Ignore:
Timestamp:
02/12/08 07:59:23 (1 year ago)
Author:
morris
Message:

Fix problems with decompressing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libwired/trunk/libwired/p7/wi-p7-socket.c

    r5253 r5257  
    954954        } 
    955955         
    956         p7_spec = wi_p7_spec_init_with_string(wi_p7_spec_alloc(), string); 
     956        p7_spec = wi_p7_spec_init_with_string(wi_p7_spec_alloc(), string, 
     957                wi_p7_spec_opposite_originator(wi_p7_spec_originator(p7_socket->spec))); 
    957958         
    958959        if(!p7_spec) 
     
    12541255                input                           += input_processed; 
    12551256                input_size                      -= input_processed; 
     1257                 
     1258                if(compression == _WI_P7_SOCKET_DECOMPRESS && input_size == 0) 
     1259                        break; 
    12561260        } 
    12571261         
     
    12661270static int _wi_p7_socket_xflate_buffer(z_stream *stream, _wi_p7_socket_compression_t compression, const void *input, uint32_t input_size, uint32_t *input_processed, void *output, uint32_t *output_size) { 
    12671271        int             err; 
    1268          
     1272 
    12691273    stream->next_in             = (Bytef *) input; 
    12701274    stream->avail_in    = input_size; 
     
    12741278    stream->avail_out   = *output_size; 
    12751279    stream->total_out   = 0; 
    1276  
     1280         
    12771281        if(compression == _WI_P7_SOCKET_COMPRESS) 
    12781282                err = deflate(stream, Z_SYNC_FLUSH); 
     
    12801284                err = inflate(stream, Z_SYNC_FLUSH); 
    12811285     
    1282     *input_processed    = stream->total_in; 
    1283     *output_size                = stream->total_out; 
     1286        if(err == Z_OK) { 
     1287                *input_processed        = stream->total_in; 
     1288                *output_size            = stream->total_out; 
     1289        } 
    12841290     
    12851291        return err;