anchor.diff:  			Session#session{queue_length =
   					%% Queue + current
   					queue:len(Pipeline) + 1},
  -		    insert_session(NewSession, ProfileName),
  -		    Relaxed = 
  -			(NextRequest#request.settings)#http_options.relaxed,
  -		    MFA = {httpc_response, 
  -			   parse,
  -			   [State#state.max_header_size, Relaxed]}, 
  -		    NewState = 
  -			State#state{pipeline    = Pipeline,
  -				    request     = NextRequest,
  -				    mfa         = MFA,
  -				    status_line = undefined,
  -				    headers     = undefined,
  -				    body        = undefined},
  -		    case Data of
  -			<<>> ->
  -			    activate_once(Session), 
  -			    {noreply, NewState};
  -			_ ->
  -			    %% If we already received some bytes of
  -			    %% the next response
  -			    handle_info({httpc_handler, dummy, Data}, 
  -					NewState) 
  -		    end
  +		    receive_response(NextRequest,
  +				     NewSession, Data,
  +				     State#state{pipeline = Pipeline})
   	    end
       end.
   
  -handle_keep_alive_queue(
  -  #state{status       = keep_alive,
  -	 session      = Session,
  -	 profile_name = ProfileName,
  -	 options      = #options{keep_alive_timeout = TimeOut}} = State, 
  -  Data) ->
  +handle_keep_alive_queue(#state{status       = keep_alive,
  +			       session      = Session,
  +			       profile_name = ProfileName,
  +			       options      = #options{keep_alive_timeout = TimeOut}} = State,
  +			Data) ->
   
       ?hcrd("handle keep_alive", [{profile, ProfileName}, 
   				{session, Session},
  
positive.code:                                         client_close = ClientClose},
                      insert_session(NewSession, ProfileName),
                      ?hcrd("session updated", []),
                      {reply, ok, State#state{pipeline = NewPipeline,
                                              session  = NewSession,
                                              timers   = NewTimers}};
                  undefined ->
                      %% Note: tcp-message receiving has already been
                      %% activated by handle_pipeline/2.
  
negative.code: 		      State#state{keep_alive = KeepAlive}, Data);
  		false ->
  		    ?hcrv("next request", [{request, NextRequest}]),
  		    #request{address = Address} = NextRequest,
  		    case httpc_request:send(Address, Session, NextRequest) of
  			ok ->
  			    receive_response(NextRequest,
  					     Session, <<>>,
  					     State#state{keep_alive = KeepAlive});
  			{error, Reason} ->
  			    {reply, {keep_alive_failed, Reason}, State}
  		    end
  	    end
      end.
  
  handle_empty_queue(Session, ProfileName, TimeOut, State) ->
      %% The server may choose too terminate an idle pipline| keep_alive session
      %% in this case we want to receive the close message
      %% at once and not when trying to send the next
      %% request.
      activate_once(Session),
      %% If a pipline | keep_alive session has been idle for some time is not
      %% closed by the server, the client may want to close it.
      NewState = activate_queue_timeout(TimeOut, State),
      update_session(ProfileName, Session, #session.queue_length, 0),
      %% Note mfa will be initilized when a new request
      %% arrives.
      {noreply,
       NewState#state{request     = undefined,
  		    mfa         = undefined,
  		    status_line = undefined,
  		    headers     = undefined,
  		    body        = undefined
  			   }
      }.
  
  receive_response(Request, Session, Data, State) ->
      NewState = init_wait_for_response_state(Request, State),
      gather_data(Data, Session, NewState).
  
  init_wait_for_response_state(Request, State) ->
      Relaxed =
  	(Request#request.settings)#http_options.relaxed,
      MFA     = {httpc_response, parse,
  	       [State#state.max_header_size, Relaxed]},
      State#state{request     = Request,
  		mfa         = MFA,
  		status_line = undefined,
  		headers     = undefined,
  		body        = undefined}.
  
  gather_data(<<>>, Session, State) ->
      activate_once(Session),
      {noreply, State};
  gather_data(Data, _, State) ->
      %% If we already received some bytes of
      %% the next response
      handle_info({httpc_handler, dummy, Data}, State).
  
  case_insensitive_header(Str) when is_list(Str) ->
      http_util:to_lower(Str);
  