Data loss with TCP sockets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 25, 2008 at 9:36 AM, Helmut Wolf <HelmutWolf1 at gmx.de> wrote:

> Hi Benny,
>
> I am using stateful_proxy under Linux Debian which works very fine. But
> sometimes on high data traffic I am wondering about having
> data loss when using TCP connections. For e.g. when sending many SIP
> messages one of them is incomplete and the next one is attached
> to this incomplete packet which results to invalid message.
>
> The reason is on send- function in pj_sock_send(): On high traffic
> sometimes it returns EAGAIN / EWOULDBLOCK. In this case pjsip
> tries to send the packet asynchronously and everything is fine. But
> sometimes send() can only send a packet fragment and returns the
> number of bytes sended (which is then smaller then the packet size).
> pj_sock_send() returns PJ_SUCCESS because the return value is >
> 0 but there is no check if the complete packet is sended.
>
> A solution is that pjsip detects if only a packet fragment was sended and
> tries to send the rest of packet asynchronously.
>

I skim through the code briefly and I think you could be right. But this
scenario is quite obvious that frankly I'm surprised that it's not handled.
I just filed this in http://trac.pjsip.org/repos/ticket/579 for now, I'll
check it again more thoroughly and fix it ASAP.

Thanks for the report.

Cheers
 -benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080725/e3f881b6/attachment.html 


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux