--- otp_src_R13B02-1.orig/lib/inets/src/http_client/httpc_handler.erl	2009-09-18 16:12:59.000000000 +0200
+++ otp_src_R13B02-1/lib/inets/src/http_client/httpc_handler.erl	2009-10-14 09:22:46.000000000 +0200
@@ -505,10 +505,25 @@
     {stop, normal, 
      State#state{canceled = [RequestId | State#state.canceled],
 		 request = Request#request{from = answer_sent}}};
-handle_info({timeout, RequestId}, State = #state{request = Request}) ->
-    httpc_response:send(Request#request.from, 
-		       httpc_response:error(Request,timeout)),
-    {noreply, State#state{canceled = [RequestId | State#state.canceled]}};
+handle_info({timeout, RequestId}, State) ->
+    Fun = fun
+	(#request{id = Id} = Request) when Id == RequestId ->
+	    httpc_response:send(Request#request.from,
+				httpc_response:error(Request,timeout)),
+	    [Request#request{from = answer_sent}];
+	(_) ->
+	    true
+    end,
+    case State#state.status of
+	pipeline ->
+	    Pipeline = queue:filter(Fun, State#state.pipeline),
+	    {noreply, State#state{canceled = [RequestId | State#state.canceled],
+				  pipeline = Pipeline}};
+	keep_alive ->
+	    KeepAlive = queue:filter(Fun, State#state.keep_alive),
+	    {noreply, State#state{canceled = [RequestId | State#state.canceled],
+				  keep_alive = KeepAlive}}
+    end;
 
 handle_info(timeout_queue, State = #state{request = undefined}) ->
     {stop, normal, State};
@@ -588,6 +603,12 @@
 	true ->
 	    ok
     end,
+    case queue:is_empty(State#state.keep_alive) of 
+	false ->
+	    retry_pipline(queue:to_list(State#state.keep_alive), State);
+	true ->
+	    ok
+    end,
     cancel_timer(Timers#timers.queue_timer, timeout_queue),
     Socket = Session#tcp_session.socket, 
     http_transport:close(socket_type(Session#tcp_session.scheme), Socket);
@@ -1191,6 +1212,8 @@
 retry_pipline([], _) ->
     ok;
 
+retry_pipline([#request{from = answer_sent}|PipeLine], State) ->
+    retry_pipline(PipeLine, State);
 retry_pipline([Request |PipeLine],  State = 
 	      #state{timers = Timers, profile_name = ProfileName}) ->
     NewState =
