Commits

Anonymous committed 62f72bc

Move a function (in the same source file)...

Comments (0)

Files changed (1)

src/lhttpc_client.erl

             erlang:error(Reason)
     end.
 
-maybe_close_socket(Socket, Ssl, {1, Minor}, ReqHdrs, RespHdrs) when Minor >= 1->
-    ClientConnection = ?CONNECTION_HDR(ReqHdrs, "keep-alive"),
-    ServerConnection = ?CONNECTION_HDR(RespHdrs, "keep-alive"),
-    if
-        ClientConnection =:= "close"; ServerConnection =:= "close" ->
-            lhttpc_sock:close(Socket, Ssl),
-            undefined;
-        ClientConnection =/= "close", ServerConnection =/= "close" ->
-            Socket
-    end;
-maybe_close_socket(Socket, Ssl, {0, _}, ReqHdrs, RespHdrs) ->
-    ClientConnection = ?CONNECTION_HDR(ReqHdrs, "keep-alive"),
-    ServerConnection = ?CONNECTION_HDR(RespHdrs, "close"),
-    if
-        ClientConnection =:= "close"; ServerConnection =/= "keep-alive" ->
-            lhttpc_sock:close(Socket, Ssl),
-            undefined;
-        ClientConnection =/= "close", ServerConnection =:= "keep-alive" ->
-            Socket
-    end.
-
 read_body(Vsn, Hdrs, Ssl, Socket) ->
     % Find out how to read the entity body from the request.
     % * If we have a Content-Length, just use that and read the complete
         {error, Reason} ->
             erlang:error(Reason)
     end.
+
+maybe_close_socket(Socket, Ssl, {1, Minor}, ReqHdrs, RespHdrs) when Minor >= 1->
+    ClientConnection = ?CONNECTION_HDR(ReqHdrs, "keep-alive"),
+    ServerConnection = ?CONNECTION_HDR(RespHdrs, "keep-alive"),
+    if
+        ClientConnection =:= "close"; ServerConnection =:= "close" ->
+            lhttpc_sock:close(Socket, Ssl),
+            undefined;
+        ClientConnection =/= "close", ServerConnection =/= "close" ->
+            Socket
+    end;
+maybe_close_socket(Socket, Ssl, {0, _}, ReqHdrs, RespHdrs) ->
+    ClientConnection = ?CONNECTION_HDR(ReqHdrs, "keep-alive"),
+    ServerConnection = ?CONNECTION_HDR(RespHdrs, "close"),
+    if
+        ClientConnection =:= "close"; ServerConnection =/= "keep-alive" ->
+            lhttpc_sock:close(Socket, Ssl),
+            undefined;
+        ClientConnection =/= "close", ServerConnection =:= "keep-alive" ->
+            Socket
+    end.