<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font size="-1">Hi,<br>
<br>
<br>
I confirm that what Rahul faced is exactly the same as I face.<br>
The easiest way to reproduce is to send "big" amount of data (>
32K). In such situation, the TCP window of the socket is full and
a fragment will be received after multiple call to recv on the
socket.<br>
This leads to multiple call of nopoll_conn_get_msg and in
particular, for the last fragment where is_final is set for each
call of nopoll_conn_get_msg<br>
<br>
I don't see any problem that nopoll_conn_get_msg does not match
exact web socket level fragmentation.<br>
The only problem is to be sure to detect end of transfer, which is
not possible in this situation<br>
<br>
In the code, has_fin and is_fragment are reflecting the web socket
state but not no_poll abstraction. This is the case for fragment
(cf nopoll_msg_is_fragment), may be the case for fin, what
explains my (very) simple patch.<br>
<br>
<br>
NB: you may also reproduce the issue with a "slow" connection<br>
I often use nodejs + websocket plugin to test my code<br>
<br>
<br>
</font>
<pre class="moz-signature" cols="72">Best regards,
--
Emmanuel Puig
Amarisoft R&D Manager</pre>
<div class="moz-cite-prefix">On 02/14/2017 09:06 PM, Kale, Rahul
wrote:<br>
</div>
<blockquote
cite="mid:CD358872C6BDFC4181B0F121C49FAF55FC308E58@DULMEX11.barco.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hello
Francis,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks
for the quick response!<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I
was actually referring to my earlier posts in June 2016.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">(the
gethostbyname() issue was in October 2016 which is now
resolved).<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Back
in June I had a series of posts (some of them related to
final flag) titled:<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">[noPoll]
Stress Test -- Client connection timeouts Kale, Rahul<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">[noPoll]
Stress Test -- Client connection timeouts Kale, Rahul<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">[noPoll]
Stress Test -- Final Flag after calling
nopoll_conn_get_msg Kale, Rahul<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">[noPoll]
Stress Test -- Final Flag after calling
nopoll_conn_get_msg Kale, Rahul<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">[noPoll]
Stress Test -- Final Flag after calling
nopoll_conn_get_msg Kale, Rahul<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">[noPoll]
Websocket diconnect issues -- stress test Kale, Rahul<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Rahul<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in
0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">
Francis Brosnan Blázquez
[<a class="moz-txt-link-freetext" href="mailto:francis.brosnan@aspl.es">mailto:francis.brosnan@aspl.es</a>]
<br>
<b>Sent:</b> Tuesday, February 14, 2017 10:36 AM<br>
<b>To:</b> Kale, Rahul<br>
<b>Cc:</b> Emmanuel Puig; <a class="moz-txt-link-abbreviated" href="mailto:nopoll@lists.aspl.es">nopoll@lists.aspl.es</a><br>
<b>Subject:</b> Re: [noPoll] [Amarisoft] Patch
proposal<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hello Rahul, <br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">Also, please refer to my posts back in
June 2016 to the mailing list regarding various issues with
the final flag.
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
About this issue, I remember you found out that DNS
resolution API<br>
what the cause of your stress test problems:<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><i><a
moz-do-not-send="true"
href="http://lists.aspl.es/pipermail/nopoll/2016-October/000156.html">http://lists.aspl.es/pipermail/nopoll/2016-October/000156.html</a></i><br>
<br>
<i>I have narrowed down the cause of intermittent failures
in our stress</i><br>
<i>test cases to the use of gethostbyname() in noPoll
library.</i><br>
<i>This function is not thread safe under Linux (possibly
other platforms too).</i><o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">I replied
you that we did an update that included this change
(gethostbyname
<br>
replacement):<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><i><a
moz-do-not-send="true"
href="http://lists.aspl.es/pipermail/nopoll/2016-November/000157.html">http://lists.aspl.es/pipermail/nopoll/2016-November/000157.html</a></i><br>
<br>
<i>At the same time, that code update already replaced
gethostbyname</i><br>
<i>by getaddrinfo, so next stable release, or current github
stable release</i><br>
<i>(305) [1] should also fix your issue.</i><o:p></o:p></p>
<p class="MsoNormal">However, I didn't receive any reply about
the matter. Maybe you can clarify<br>
if the issue persisted (even having gethostbyname replaced)
and how this<br>
relates to Emmanuel's patch,<br>
<br>
Best Regards,<br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">Regards, <o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</blockquote>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Rahul <o:p></o:p></p>
</blockquote>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</blockquote>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><o:p> </o:p></p>
</blockquote>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">On Feb 14, 2017 6:43 AM, Emmanuel Puig
<<a moz-do-not-send="true"
href="mailto:emmanuel.puig@amarisoft.com">emmanuel.puig@amarisoft.com</a>>
wrote:
<o:p></o:p></p>
</blockquote>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi,<br>
<br>
<br>
I'm Emmanuel Puig from Amarisoft company and we are
using your stack for <br>
WebSocket.<br>
I've reported a patch few years ago that you had
integrated.<br>
<br>
Here is another patch proposal for a bug we encounter
with huge amount <br>
of transferred data.<br>
<br>
At the end of a transfer, if the final fragment is
received from socket <br>
in chunks, each chunk is tagged as final and fragment <br>
(nopoll_msg_is_final/nopoll_msg_is_fragment)<br>
This forbids to detect the exact end of the message.<br>
<br>
The patch avoids to set final when if there are
remaining data.<br>
<br>
Best regards,<o:p></o:p></p>
<pre><o:p> </o:p></pre>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>noPoll mailing list<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="mailto:noPoll@lists.aspl.es">noPoll@lists.aspl.es</a><o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="http://lists.aspl.es/cgi-bin/mailman/listinfo/nopoll">http://lists.aspl.es/cgi-bin/mailman/listinfo/nopoll</a><o:p></o:p></pre>
</blockquote>
</blockquote>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</blockquote>
<table class="MsoNormalTable" style="width:100.0%"
width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="padding:0in 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt">--
Francis Brosnan Blázquez - ASPL 91 134 14 22 - 91
134 14 45 - 91 116 07 57
<br>
<br>
<a moz-do-not-send="true" href="http://aspl.es">http://aspl.es</a>
<a moz-do-not-send="true"
href="http://asplhosting.com">http://asplhosting.com</a>
<a moz-do-not-send="true"
href="http://twitter.com/aspl_es">http://twitter.com/aspl_es</a>
<a moz-do-not-send="true"
href="http://twitter.com/asplhosting">
http://twitter.com/asplhosting</a> <br>
<br>
AVISO LEGAL <br>
<br>
Este mensaje se dirige exclusivamente a su
destinatario. Los datos incluidos en el presente
correo son confidenciales y sometidos a secreto
profesional, se prohíbe divulgarlos, en virtud de
las leyes vigentes. Si usted no lo es y lo ha
recibido por error o tiene conocimiento del mismo
por cualquier motivo, le rogamos que nos lo
comunique por este medio y proceda a destruirlo o
borrarlo.
<br>
<br>
En virtud de lo dispuesto en la Ley Orgánica
15/1999, de 13 de diciembre, de Protección de Datos
de Carácter Personal, le informamos de que sus datos
de carácter personal, recogidos de fuentes
accesibles al público o datos que usted nos ha
facilitado previamente, proceden de bases de datos
propiedad de Advanced Software Production Line, S.L.
(ASPL). No obstante, usted puede ejercitar sus
derechos de acceso, rectificación, cancelación y
oposición dispuestos en la mencionada Ley Orgánica,
notificándolo por escrito a: ASPL - Protección
Datos, C/Antonio Suárez 10 A-102, 28802, Alcalá de
Henares (Madrid).
<o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
This message is subject to the following terms and conditions: <a
moz-do-not-send="true"
href="http://www.barco.com/en/maildisclaimer">
MAIL DISCLAIMER</a>
</blockquote>
<br>
</body>
</html>