anchor.diff:  	end,
       {atomic, _} = mnesia:transaction(F).
   
  -one_request_done(#state{dumb = false,
  -			requests = [Request | Requests]} = State) ->
  +one_request_done(#state{dumb = Dumb,
  +			requests = [Request | Requests],
  +			socket = Socket,
  +			zstream = ZStream} = State) ->
       request_done(Request),
  -    requests_send_ahead(State#state{requests = Requests});
  -
  -one_request_done(#state{dumb = true,
  -			requests = [Request | _],
  -			socket = Socket} = State) ->
  -    request_done(Request),
  -    gen_tcp:close(Socket),
  -    State#state{socket = none}.
  +    case ZStream of
  +	none ->
  +	    ignore;
  +	_ ->
  +	    ok = zlib:inflateEnd(ZStream),
  +	    ok = zlib:close(ZStream)
  +    end,
  +    if
  +	Dumb ->
  +	    gen_tcp:close(Socket),
  +	    State#state{socket = none};
  +	true ->
  +	    requests_send_ahead(State#state{requests = Requests})
  +    end.
   
   %% HTTP Engine
   
  
positive.code: 		   requests = [#http_request{host = Host, path = Path,
  					     listener = Listener} | _]} = State) ->
  
      error_logger:info_msg("~p got response for ~p ~p:~n~p",
  			  [self(), Host, Path, {Code, Status, Headers}]),
      Listener ! {response, Code, Status, Headers},
  
      Chunked =
  	case lists:keysearch("transfer-encoding", 1, Headers) of
  	    {value, {_, [$c, $h, $u, $n, $k, $e, $d | _]}} ->
  
negative.code: 
  
  handle_chunk(Chunk, #state{requests = [#http_request{listener = Listener} | _]} = State) ->
      case State#state.zstream of
  	none ->
  	    Listener ! {body, Chunk};
  	ZStream ->
  	    DecompressedChunk =
  		lists:flatten([binary_to_list(D) ||
  				  D <- zlib:inflate(ZStream, list_to_binary(Chunk))]),
  	    Listener ! {body, DecompressedChunk}
      end,
      State.
  
  handle_packet_end(#state{chunked = true} = State) ->
  