aboutsummaryrefslogtreecommitdiffstats
path: root/lib/orber/COSS
diff options
context:
space:
mode:
authorNiclas Eklund <[email protected]>2010-10-19 15:58:16 +0200
committerNiclas Eklund <[email protected]>2010-10-19 15:58:16 +0200
commit64df27c91db991550bdd6c97862eb26c1c9e37bf (patch)
treef0fd2ecd170f0a818f584d86130c18aa9a0aa2f5 /lib/orber/COSS
parent5ddf44bb91540fd88e604f077d71482c40185cd8 (diff)
downloadotp-64df27c91db991550bdd6c97862eb26c1c9e37bf.tar.gz
otp-64df27c91db991550bdd6c97862eb26c1c9e37bf.tar.bz2
otp-64df27c91db991550bdd6c97862eb26c1c9e37bf.zip
A corbaloc http string could return an EXIT message, instead of a system
exception, if the HTTP server closed the socket without returning a complete message. I.e. header and a body containing a stringified IOR.
Diffstat (limited to 'lib/orber/COSS')
-rw-r--r--lib/orber/COSS/CosNaming/orber_cosnaming_utils.erl13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/orber/COSS/CosNaming/orber_cosnaming_utils.erl b/lib/orber/COSS/CosNaming/orber_cosnaming_utils.erl
index 7792839e22..768653c898 100644
--- a/lib/orber/COSS/CosNaming/orber_cosnaming_utils.erl
+++ b/lib/orber/COSS/CosNaming/orber_cosnaming_utils.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -536,8 +536,15 @@ lookup(_, _Ctx) ->
receive_msg(Socket, Acc, Timeout) ->
receive
{tcp_closed, Socket} ->
- [_Header, Body] = re:split(Acc,"\r\n\r\n",[{return,list}]),
- Body;
+ case re:split(Acc,"\r\n\r\n",[{return,list}]) of
+ [_Header, Body] ->
+ Body;
+ What ->
+ orber:dbg("[~p] orber_cosnaming_utils:receive_msg();~n"
+ "HTTP server closed the connection before sending a complete reply: ~p.",
+ [?LINE, What], ?DEBUG_LEVEL),
+ corba:raise(#'COMM_FAILURE'{completion_status=?COMPLETED_NO})
+ end;
{tcp, Socket, Response} ->
receive_msg(Socket, Acc ++ Response, Timeout);
{tcp_error, Socket, Reason} ->