LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0262-inets-Remove-httpc-dead-code-re-init-error.patch of Package erlang (Project home:Ledest:erlang:20)

From 2591eddc8db45c89e01ceefa009537aaf660ac82 Mon Sep 17 00:00:00 2001
From: Luca Favatella <luca.favatella@erlang-solutions.com>
Date: Fri, 16 Mar 2018 21:03:19 +0000
Subject: [PATCH 2/9] inets: Remove httpc dead code re init error

... i.e. references to `connect_failed` and `send_failed`, unused
since 5d32eaf750 .
---
 lib/inets/doc/src/httpc.xml                 |  3 +--
 lib/inets/src/http_client/httpc_handler.erl | 21 +--------------------
 2 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/lib/inets/doc/src/httpc.xml b/lib/inets/doc/src/httpc.xml
index 14662f257c..ffc6fec518 100644
--- a/lib/inets/doc/src/httpc.xml
+++ b/lib/inets/doc/src/httpc.xml
@@ -312,8 +312,7 @@
         <v>Body = string() | binary()</v>
         <v>Profile = profile() | pid()</v>
 	<d>When started <c>stand_alone</c> only the pid can be used.</d>
-        <v>Reason = {connect_failed, term()} | 
-                    {send_failed, term()} | term()</v>
+        <v>Reason = term()</v>
       </type>
 
       <desc>
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl
index 9b09832eb8..327aec4baa 100644
--- a/lib/inets/src/http_client/httpc_handler.erl
+++ b/lib/inets/src/http_client/httpc_handler.erl
@@ -48,12 +48,10 @@
           queue_timer         :: reference() | 'undefined'
          }).
 
--type session_failed() :: {'connect_failed',term()} | {'send_failed',term()}.
-
 -record(state, 
         {
           request                   :: request() | 'undefined',
-          session                   :: session() | session_failed() | 'undefined',
+          session                   :: session() | 'undefined',
           status_line,               % {Version, StatusCode, ReasonPharse}
           headers                   :: http_response_h() | 'undefined',
           body                      :: binary() | 'undefined',
@@ -295,23 +293,6 @@ handle_info(Info, State) ->
 %% Description: Shutdown the httpc_handler
 %%--------------------------------------------------------------------
 
-%% Init error there is no socket to be closed.
-terminate(normal, 
-          #state{request = Request, 
-                 session = {send_failed, _} = Reason} = State) ->
-    maybe_send_answer(Request, 
-                      httpc_response:error(Request, Reason), 
-                      State),
-    ok; 
-
-terminate(normal, 
-          #state{request = Request, 
-                 session = {connect_failed, _} = Reason} = State) ->
-    maybe_send_answer(Request, 
-                      httpc_response:error(Request, Reason), 
-                      State),
-    ok; 
-
 terminate(normal, #state{session = undefined}) ->
     ok;  
 
-- 
2.16.3