8282-define (SSL_CLOSE_TIMEOUT , 5000 ).
8383
8484-define (IS_SSL (Sock ), is_tuple (Sock )
85- andalso (tuple_size (Sock ) =:= 3 )
8685 andalso (element (1 , Sock ) =:= sslsocket )).
8786
8887is_ssl (Sock ) -> ? IS_SSL (Sock ).
8988
90- % % Seems hackish. Is hackish. But the structure is stable and
91- % % kept this way for backward compatibility reasons. We need
92- % % it for two reasons: there are no ssl:getstat(Sock) function,
93- % % and no ssl:close(Timeout) function. Both of them are being
94- % % worked on as we speak.
95- ssl_get_socket (Sock ) ->
96- element (2 , element (2 , Sock )).
97-
9889ssl_info (Sock ) when ? IS_SSL (Sock ) ->
9990 ssl :connection_information (Sock );
10091ssl_info (_Sock ) ->
@@ -119,12 +110,12 @@ controlling_process(Sock, Pid) when is_port(Sock) ->
119110 gen_tcp :controlling_process (Sock , Pid ).
120111
121112getstat (Sock , Stats ) when ? IS_SSL (Sock ) ->
122- inet :getstat (ssl_get_socket ( Sock ) , Stats );
113+ ssl :getstat (Sock , Stats );
123114getstat (Sock , Stats ) when is_port (Sock ) ->
124115 inet :getstat (Sock , Stats );
125116% % Used by Proxy protocol support in plugins
126117getstat ({rabbit_proxy_socket , Sock , _ }, Stats ) when ? IS_SSL (Sock ) ->
127- inet :getstat (ssl_get_socket ( Sock ) , Stats );
118+ ssl :getstat (Sock , Stats );
128119getstat ({rabbit_proxy_socket , Sock , _ }, Stats ) when is_port (Sock ) ->
129120 inet :getstat (Sock , Stats ).
130121
@@ -197,7 +188,7 @@ fast_close(Sock) when ?IS_SSL(Sock) ->
197188 {'DOWN' , MRef , process , Pid , _Reason } ->
198189 ok
199190 end ,
200- catch port_close ( ssl_get_socket ( Sock ) ),
191+ catch ssl : close ( Sock ),
201192 ok ;
202193fast_close (Sock ) when is_port (Sock ) ->
203194 catch port_close (Sock ), ok .
0 commit comments