-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wamp_session::process_challenge protocol_error throws will crash the application #232
Comments
why is that required? calling code can catch exceptions thrown in async code like this https://github.com/crossbario/autobahn-cpp/blob/master/examples/caller.cpp |
mmh ... wait .. maybe I'm confused .. other places in the session code do similar as you suggest: autobahn-cpp/autobahn/wamp_session.ipp Line 189 in 0fb8045
|
aaah, ok: so the session code throws protocol errors, but uses setting the exception on a future in cases the application can / want to react to in a regular fashion. so the actual Q is: in this specific case, the signature of the challenge sent by the client could not be verified by the router, and hence the router denies the client authentication. this isn't a protocol error so .. |
router didnt deny anything, send_message threw from any reason such as no transport. |
well, why would throwing an exception crash a program necessarily? just catch it? not sure, I'm not using c++ often these days, and these arcane styles;) anyways, this code has the pattern I believe to be correct: autobahn-cpp/autobahn/wamp_session.ipp Line 810 in 0fb8045
rethinking about the issue you posted: if a signature could not be verified, the WAMP openening handshake fails, and a completely new session and handshake must be performed (at the WAMP protocol level). so that means, m_session_join should complete with error, but it is not a fatal error (like eg the router talking gibberish bytes ..) |
Thanks for looking into this so quickly. Example of the stack: VCRUNTIME140!_CxxThrowException+0x66 [throw.cpp @ 74] |
m_session_join has to take the exception instead of throwing so connecting(and challenged) client can react on .get() instead of the whole application crashing from the unhandled exception (which is thrown inside of the asio_context loop).
one of the places with a possible fix:
The text was updated successfully, but these errors were encountered: