Skip to content
This repository
Browse code

Merge pull request #78 from fgc/master

misultin_http:socket_loop together with socket.io-erlang
  • Loading branch information...
commit ddf6b45d926e3860280ad99f5d9b9eb79a12a90a 2 parents f1b94c2 + d4eef97
Roberto Ostinelli authored November 27, 2011

Showing 1 changed file with 8 additions and 8 deletions. Show diff stats Hide diff stats

  1. 16  src/misultin_http.erl
16  src/misultin_http.erl
@@ -580,7 +580,7 @@ socket_loop(#c{compress = Compress} = C, #req{socket = Sock, socket_mode = Socke
580 580
 			misultin_socket:send(Sock, Resp, SocketMode),
581 581
 			% loop and save sent status
582 582
 			socket_loop(C, Req, LoopPid, ReqOptions, AppHeaders, HttpCode, size(BodyBinary));
583  
-		{LoopPid, {reqinfo, ReqInfo}} ->
  583
+		{Pid, {reqinfo, ReqInfo}} ->
584 584
 			ReqResponse = case ReqInfo of
585 585
 				raw				-> Req;
586 586
 				socket			-> Req#req.socket;
@@ -598,9 +598,9 @@ socket_loop(#c{compress = Compress} = C, #req{socket = Sock, socket_mode = Socke
598 598
 				body			-> Req#req.body
599 599
 			end,
600 600
 			?LOG_DEBUG("received request info for: ~p, responding with ~p", [ReqInfo, ReqResponse]),
601  
-			misultin_utility:respond(LoopPid, ReqResponse),
  601
+			misultin_utility:respond(Pid, ReqResponse),
602 602
 			socket_loop(C, Req, LoopPid, ReqOptions, AppHeaders, HttpCodeSent, SizeSent);
603  
-		{LoopPid, {session_cmd, SessionCmd}} ->
  603
+		{Pid, {session_cmd, SessionCmd}} ->
604 604
 			?LOG_DEBUG("received a session command: ~p", [SessionCmd]),
605 605
 			case SessionCmd of
606 606
 				{session, Cookies} ->
@@ -608,24 +608,24 @@ socket_loop(#c{compress = Compress} = C, #req{socket = Sock, socket_mode = Socke
608 608
 					case misultin_sessions:session(C#c.sessions_ref, Cookies, Req) of
609 609
 						{error, Reason} ->
610 610
 							?LOG_DEBUG("error getting/creating session: ~p", [Reason]),
611  
-							misultin_utility:respond(LoopPid, {error, Reason});
  611
+							misultin_utility:respond(Pid, {error, Reason});
612 612
 						{SessionId, _SessionVars} = SessionInfo ->
613 613
 							?LOG_DEBUG("got session info: ~p", [SessionInfo]),
614 614
 							% respond with session id
615  
-							misultin_utility:respond(LoopPid, SessionInfo),
  615
+							misultin_utility:respond(Pid, SessionInfo),
616 616
 							% add session id cookie header
617 617
 							socket_loop(C, Req, LoopPid, ReqOptions, [misultin_sessions:set_session_cookie(SessionId)|AppHeaders], HttpCodeSent, SizeSent)
618 618
 					end;
619 619
 				{save_session_state, SessionId, SessionState} ->
620 620
 					% save session state
621 621
 					Response = misultin_sessions:save_session_state(C#c.sessions_ref, SessionId, SessionState, Req),
622  
-					misultin_utility:respond(LoopPid, Response),
  622
+					misultin_utility:respond(Pid, Response),
623 623
 					% loop
624 624
 					socket_loop(C, Req, LoopPid, ReqOptions, AppHeaders, HttpCodeSent, SizeSent)
625 625
 			end;
626  
-		{LoopPid, body_recv} ->
  626
+		{Pid, body_recv} ->
627 627
 			?LOG_DEBUG("received a request to manually read the body",[]),			
628  
-			misultin_utility:respond(LoopPid, read_body(chunk, C, Req)),
  628
+			misultin_utility:respond(Pid, read_body(chunk, C, Req)),
629 629
 			% loop
630 630
 			socket_loop(C, Req, LoopPid, ReqOptions, AppHeaders, HttpCodeSent, SizeSent);
631 631
 		{set_cookie, CookieHeader} ->

0 notes on commit ddf6b45

Please sign in to comment.
Something went wrong with that request. Please try again.