Erlang/OTP Forums

Author Message

<  Yaws mailing list  ~  Bug? Code in soap server module crashes Yaws

Guest
Posted: Sat Oct 13, 2007 6:46 pm Reply with quote
Guest
(Sorry if this is a re-post. Since some people reportedly did not see
it when I sent it some 10 days ago I don't think it got through ok.)

Hello all,

I'm an Erlang newbie, so please don't hit me too hard if I fail in my
beginning, baby steps into this wonderful new world. Smile

I'm developing web services with Yaws, and I've found some code in the
soap server module that can be (mis-) used to crash the web server. If
a soap client sends a request for a web service that's not started on
the server, yaws will crash instead of returning a nice error message.

The functions involved are request/5 and handle_call/3 in
yaws_soap_srv module. I've written my own code to handle this. My code
might not be the perfect solution, but anyway, the problem perhaps
should be fixed in the next version of Yaws?

My code (original code are commented out):

handle_call( {request, Id, Payload, SessionValue, SoapAction}, _From, State) ->
% Reply = request(State, Id, Payload, SessionValue, SoapAction),
% {reply, Reply, State}.

try request(State, Id, Payload, SessionValue, SoapAction) of
Reply -> {reply, Reply, State}
catch
throw: model_error ->
{reply, cli_error("Model error."), State};
throw: _ ->
{reply, srv_error("Unknown server error."), State}
end.

request(State, {M,F} = Id, Payload, SessionValue, Action) ->
% {ok, Model} = get_model(State, Id),

{Status, Model} = get_model(State, Id),
case Status of
ok -> ok;
error -> throw(model_error);
_ -> throw(other_error)
end,
[remaining code left out]

Regards,
Andreas

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist
Willem
Posted: Sun Oct 14, 2007 3:29 pm Reply with quote
User Joined: 21 Jul 2006 Posts: 59
Good to know.
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum