Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix to bug #50

  • Loading branch information...
commit a7a71f9814548d54ecc20b5fa701bf1dbd799f21 1 parent 4bff2ef
@omarkj omarkj authored
View
7 src/socketio_http_misultin.erl
@@ -36,7 +36,12 @@ stream(Request, Data) ->
misultin_req:stream(Data, Request).
socket(Request) ->
- misultin_req:get(socket, Request).
+ get_socket(misultin_req:get(socket, Request)).
+
+get_socket({sslsocket, new_ssl, Pid}) ->
+ Pid;
+get_socket(Socket) ->
+ Socket.
get_headers(Request) ->
misultin_req:get(headers, Request).
View
5 src/socketio_transport_polling.erl
@@ -176,7 +176,7 @@ handle_cast({TransportType, polling_request, Req, Server}, #state { server_modul
handle_cast({TransportType, polling_request, Req, Server}, #state { server_module = ServerModule,
message_buffer = Buffer } = State) ->
- link(apply(ServerModule, socket, [Req])),
+ link(ServerModule:socket(Req)),
handle_cast({send, {buffer, Buffer}}, State#state{ connection_reference = {TransportType, connected},
req = Req, caller = Server, message_buffer = []});
@@ -206,7 +206,8 @@ handle_cast(_, State) ->
%% @end
%%--------------------------------------------------------------------
%% A client has disconnected. We fire a timer (CloseTimeout)!
-handle_info({'EXIT',Port,_Reason}, #state{ connection_reference = {TransportType, _ }, close_timeout = CloseTimeout} = State) when is_port(Port) ->
+handle_info({'EXIT',Connection,_Reason}, #state{ connection_reference = {TransportType, _ }, close_timeout = CloseTimeout} = State) when is_port(Connection);
+ is_pid(Connection)->
{noreply, State#state { connection_reference = {TransportType, none}}, CloseTimeout};
%% Connections has timed out, but is technically still active. This is like a
View
5 src/socketio_transport_xhr_multipart.erl
@@ -195,7 +195,6 @@ handle_cast({send, Message}, #state{ req = Req,
handle_cast(_, #state{} = State) ->
{noreply, State}.
-
%%--------------------------------------------------------------------
%% @private
%% @doc
@@ -207,7 +206,8 @@ handle_cast(_, #state{} = State) ->
%% @end
%%--------------------------------------------------------------------
%% A client has disconnected. We fire a timer (ServerTimeout)!
-handle_info({'EXIT',_Port,_Reason}, #state{ close_timeout = ServerTimeout} = State) when is_port(_Port) ->
+handle_info({'EXIT',Connection,_Reason}, #state{ close_timeout = ServerTimeout} = State) when is_port(Connection);
+ is_pid(Connection)->
{noreply, State#state { connection_reference = {'xhr-multipart', none}}, ServerTimeout};
%% This branch handles two purposes: 1. handling the close_timeout,
@@ -238,6 +238,7 @@ handle_info({timeout, _Ref, heartbeat}, State) ->
{noreply, State};
handle_info(_Info, State) ->
+ io:format("FOO"),
{noreply, State}.
%%--------------------------------------------------------------------
Please sign in to comment.
Something went wrong with that request. Please try again.