Many times (especially when there is a hacking attempt) I want to close TCP or TLS session after sending reply. So, for example, I write:
set_reply_close(); send_reply("403", "Forbidden");
It would be more convenient if these two calls could be combined into one, for example:
send_reply_and_close("403", "Forbidden");
-- Juha
Hello,
set_reply_close() is very minimal wrapper action from the core setting an internal flag. It can be merged with a reply function, but maybe it should be a new function a little bit more generic, like send_reply_mode(code, reason, mode) where mode is a parameter that can be used for other purposes in the future (by using bit-based flags).
Cheers, Daniel
On 03.11.20 07:42, Juha Heinanen wrote:
Many times (especially when there is a hacking attempt) I want to close TCP or TLS session after sending reply. So, for example, I write:
set_reply_close(); send_reply("403", "Forbidden");
It would be more convenient if these two calls could be combined into one, for example:
send_reply_and_close("403", "Forbidden");
-- Juha
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Daniel-Constantin Mierla writes:
set_reply_close() is very minimal wrapper action from the core setting an internal flag. It can be merged with a reply function, but maybe it should be a new function a little bit more generic, like send_reply_mode(code, reason, mode) where mode is a parameter that can be used for other purposes in the future (by using bit-based flags).
There may be cases where it is not good idea to close connection after reply. So it should not be automatically done by send_reply(). A new function either with or without an extra argument would be fine.
-- Juha
On 03.11.20 11:10, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
set_reply_close() is very minimal wrapper action from the core setting an internal flag. It can be merged with a reply function, but maybe it should be a new function a little bit more generic, like send_reply_mode(code, reason, mode) where mode is a parameter that can be used for other purposes in the future (by using bit-based flags).
There may be cases where it is not good idea to close connection after reply. So it should not be automatically done by send_reply().
Maybe my phrasing was confusing, I didn't want to suggest to be included in existing sl reply functions.
I wanted to say that the new function to be added should be a bit more generic, not targeting only set_reply_close()+send_reply(), but have a "mode" parameter to control what other operations should be done before sending the reply out.
Cheers, Daniel
A new function either with or without an extra argument would be fine.
-- Juha
Daniel-Constantin Mierla writes:
I wanted to say that the new function to be added should be a bit more generic, not targeting only set_reply_close()+send_reply(), but have a "mode" parameter to control what other operations should be done before sending the reply out.
That is how I understood it too. For me a new function with mode param would be fine.
-- Juha
New function added, but no testing done -- if there are issues, open a bug report.
Cheers, Daniel
On 04.11.20 13:48, Juha Heinanen wrote:
Daniel-Constantin Mierla writes:
I wanted to say that the new function to be added should be a bit more generic, not targeting only set_reply_close()+send_reply(), but have a "mode" parameter to control what other operations should be done before sending the reply out.
That is how I understood it too. For me a new function with mode param would be fine.
-- Juha