File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ defmodule Kadabra.Socket do
22 @ moduledoc false
33
44 defstruct socket: nil , buffer: "" , active_user: nil
5+ defguardp is_ssl_socket ( s ) when is_tuple ( s ) and elem ( s , 0 ) == :sslsocket
56
67 alias Kadabra.FrameParser
78
@@ -130,7 +131,7 @@ defmodule Kadabra.Socket do
130131
131132 # Internal socket helpers
132133
133- defp socket_send ( { :sslsocket , _ , _ } = pid , bin ) do
134+ defp socket_send ( pid , bin ) when is_ssl_socket ( pid ) do
134135 # IO.puts("Sending #{byte_size(bin)} bytes")
135136 :ssl . send ( pid , bin )
136137 end
@@ -139,7 +140,7 @@ defmodule Kadabra.Socket do
139140 :gen_tcp . send ( pid , bin )
140141 end
141142
142- defp setopts ( { :sslsocket , _ , _ } = pid , opts ) do
143+ defp setopts ( pid , opts ) when is_ssl_socket ( pid ) do
143144 :ssl . setopts ( pid , opts )
144145 end
145146
You can’t perform that action at this time.
0 commit comments