Resolve the issue of incomplete transmission of large SIP message over TLS protocol#3654
Conversation
|
Hi @36952362 , you have a fair point here. Taking this a step further, maybe the test of ASYNC (to have the fd added for WRITE in reactor) should be mask and automatically done in the |
|
Hi @bogdan-iancu
----proto-tcp---- ----proto-tls---- |
| send_sock->last_real_ports->remote = c->rcv.src_port; | ||
|
|
||
| tcp_conn_release(c, 0); | ||
| tcp_conn_release(c, c->async && c->async->pending?1:0); |
There was a problem hiding this comment.
OK, let's keep it local, here. Nevertheless, to avoid any clarity or synchronization issue (btw, the access to ->async->pending should be under lock), I would go for the more simpler approach from the proto_tcp, with the test on the amount of written data. Could you :
- rework the test here
- remove the
tcp_connections_nofix (to keep it in Resolve the issue of inaccurate tcp_connections_no #3664)
There was a problem hiding this comment.
Thanks for your advising.
#rework the test here
sure, I retested after re-submit(add lock protection)
#remove the tcp_connections_no fix
Sorry, It was my mistake, I used the same branch for the two PRs. I removed it
|
@36952362, maybe I failed with my explanations :). Yes, using the by comparing the overall |
|
@bogdan-iancu , your suggestion was very helpful. I was misled by the line |
Resolve the issue of incomplete transmission of large SIP message over TLS protocol (cherry picked from commit 0c54ee7)
Resolve the issue of incomplete transmission of large SIP message over TLS protocol (cherry picked from commit 0c54ee7)
Resolve the issue of incomplete transmission of large SIP message over TLS protocol (cherry picked from commit 0c54ee7)
|
Thank you @36952362 , PR merged and backported to all 3.4+ versions |
Resolve the issue of incomplete transmission of large SIP message over TLS protocol
Summary
This PR fixes the issue of incomplete transmission of large SIP message over TLS
Details
When OpenSIPS communicates with a remote UA over the TLS protocol, if the size of the SIP message large than
16,384 bytes, OpenSIPS fails to send the entire SIP message.if the DEBUG log level (
log_level=4) is enabled, the logs show that OpenSIPS sends only16,384 bytesin the first write attempt. The remaining data is stored in the TCP connection’stcp_async_chunk. However, OpenSIPS doesnotrelease thetcp connectionback to theTCP mainprocess, which would normally add it back to thereactorto listen again for thewrite event.---log snippet---
Solution
If the SIP message cannot be fully sent in the first attempt, the
tcp_connectionmust be released back to theTCP mainprocess so that it can be added to the reactor to listen for the write event again.---log snippet---
Compatibility
This is a change-specific and isolated in proto_tls module - it's 100% retro-compatible with the other versions.
Closing issues
N/A