Created
September 30, 2010 00:22
-
-
Save fdmanana/603808 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/ssl/src/ssl_broker.erl b/lib/ssl/src/ssl_broker.erl | |
index 178fb5f..7187b1f 100644 | |
--- a/lib/ssl/src/ssl_broker.erl | |
+++ b/lib/ssl/src/ssl_broker.erl | |
@@ -608,6 +608,19 @@ handle_info({tcp, Socket, Data}, | |
{noreply, St} | |
end; | |
+handle_info({tcp, Socket, Data}, | |
+ #st{active = Active, collector = Collector, status = open, | |
+ proxyport = Socket, thissock = Thissock} = St) -> | |
+ debug(St, "tcp: socket = ~w~n", [Socket]), | |
+ Msg = {ssl, Thissock, Data}, | |
+ Collector ! Msg, | |
+ if | |
+ Active =:= once -> | |
+ {noreply, St#st{active = false}}; | |
+ true -> | |
+ {noreply, St} | |
+ end; | |
+ | |
%% tcp_closed - from proxy socket, active mode | |
%% | |
%% | |
@@ -625,6 +638,19 @@ handle_info({tcp_closed, Socket}, | |
{noreply, St#st{status = closing}} | |
end; | |
+handle_info({tcp_closed, Socket}, | |
+ #st{active = Active, collector = Collector, | |
+ proxyport = Socket, thissock = Thissock} = St) -> | |
+ debug(St, "tcp_closed: socket = ~w~n", [Socket]), | |
+ Msg = {ssl_closed, Thissock}, | |
+ Collector ! Msg, | |
+ if | |
+ Active =:= once -> | |
+ {noreply, St#st{status = closing, active = false}}; | |
+ true -> | |
+ {noreply, St#st{status = closing}} | |
+ end; | |
+ | |
%% tcp_error - from proxy socket, active mode | |
%% | |
%% | |
@@ -642,6 +668,19 @@ handle_info({tcp_error, Socket, Reason}, | |
{noreply, St#st{status = closing}} | |
end; | |
+handle_info({tcp_error, Socket, Reason}, | |
+ #st{active = Active, collector = Collector, | |
+ proxyport = Socket} = St) -> | |
+ debug(St, "tcp_error: socket = ~w, reason = ~w~n", [Socket, Reason]), | |
+ Msg = {ssl_error, Socket, Reason}, | |
+ Collector ! Msg, | |
+ if | |
+ Active =:= once -> | |
+ {noreply, St#st{status = closing, active = false}}; | |
+ true -> | |
+ {noreply, St#st{status = closing}} | |
+ end; | |
+ | |
%% EXIT - from client | |
%% | |
%% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment