<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<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]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<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">Thanks for the quick update!<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">Since we foresee use of the Windows version of the library too,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I will await the next stable release that includes these changes.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">When do you plan on spinning the next release?
<br>
Should I try to compile the Windows version myself from the <br>
current SVN repository?<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 again,<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>
<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 [mailto:francis@aspl.es]
<br>
<b>Sent:</b> Thursday, May 28, 2015 7:10 AM<br>
<b>To:</b> Kale, Rahul<br>
<b>Cc:</b> nopoll@lists.aspl.es<br>
<b>Subject:</b> Re: [noPoll] Issue with using "protocols" field from the client<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hello there Rahul,<br>
<br>
Thanks for reporting. Now the issue is fixed in a consistent way at the SVN 217 and<br>
will be delivered on next stable release:<br>
<br>
<a href="https://dolphin.aspl.es/svn/publico/nopoll/">https://dolphin.aspl.es/svn/publico/nopoll/</a><br>
<br>
Now, it will work for your case without any additional effort. Now I'm on it, I've updated<br>
the API to allow handling these configurations and to allow the listener to select which<br>
protocol is supported or take any other actions, including closing the connection, when<br>
the protocol requested by the client isn't supported:<br>
<br>
- nopoll_conn_get_accepted_protocol (listener and client)<br>
- nopoll_conn_get_requested_protocol (listener)<br>
- nopoll_conn_set_accepted_protocol (listener)<br>
<br>
Added regression test (test_27) to reproduce bug reported, check fix introduced and test<br>
new API symbols added. <br>
<br>
Again, thanks for reporting ...and any twitter, web, etc, reference to our noPoll site
<br>
<a href="http://www.aspl.es/nopollis">http://www.aspl.es/nopoll</a> is more than welcome,<br>
<br>
Best Regards,<br>
<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hello,<br>
<br>
<br>
<br>
After struggling with libwebsocket library for some days I switched to using the noPoll<br>
<br>
library. So far things are going really well except I faced one issue very early on:<br>
<br>
<br>
<br>
I am using the library to make a client connection to a websocket server.<br>
<br>
After connecting to a websocket server, the connection is rejected. I see the following error<br>
<br>
after enabling debug log.<br>
<br>
<br>
<br>
(proc 23267): (critical) nopoll_conn.c:1858 (nopoll_conn_check_mime_header_repeated)
<br>
<br>
Provided header Sec-WebSocket-Protocol twice, closing connection<br>
<br>
<br>
<br>
The code is using the API somewhat like this:<br>
<br>
<br>
<br>
noPollConn * connection = nopoll_conn_new(m_pContext, "127.0.0.1", "8080", NULL,<br>
<br>
"/", "some-protocol", "some-origin");<br>
<br>
<br>
<br>
Note that we are setting the "protocols" parameter. It seems the server responds with the<br>
<br>
same protocol string set in the header for Sec-WebSocket-Protocol<br>
<br>
but the library rejects this for some reason and closes the connection.<br>
<br>
<br>
<br>
I am not sure if I am doing something wrong in how the library is used<br>
<br>
or there is some other problem. Please advise.<br>
<br>
According to the specification the client can send a list of supported protocols<br>
<br>
and the server can respond with a subset. In our case we only need to use one protocol.<br>
<br>
<br>
<br>
Anyway, after modifying the library (see below) I was able to make progress<br>
<br>
with our implementation and have not seen any other issue yet.<br>
<br>
<br>
<br>
To 'fix' the above issue I had to comment out two lines at line 2192 in nopoll_conn.c:<br>
<br>
<br>
<br>
#if 0<br>
<br>
if (nopoll_conn_check_mime_header_repeated (conn, header, value, "Sec-WebSocket-Protocol", conn->protocols))<br>
<br>
return 0;<br>
<br>
#endif<br>
<br>
<br>
<br>
Also I had to later fix an associated memory leak:<br>
<br>
<br>
<br>
else if (strcasecmp (header, "Sec-Websocket-Protocol") == 0) {<br>
<br>
nopoll_free (conn->protocols);<br>
<br>
conn->protocols = value;<br>
<br>
}<br>
<br>
<br>
<br>
This may not be the correct fix but allowed me to proceed with the rest of<br>
<br>
the implementation.<br>
<br>
<br>
<br>
Thanks,<br>
<br>
<br>
<br>
Rahul<br>
<br>
<br>
<br>
Rahul Kale<br>
<br>
<br>
<br>
IP Video Systems<br>
<br>
Barco, Inc<br>
<br>
1287 Anvilwood Ave<br>
<br>
Sunnyvale, CA 94089<br>
<br>
<br>
<br>
Tel +1 408 400 4238<br>
<br>
<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">This message is subject to the following terms and conditions:
<a href="http://www.barco.com/en/maildisclaimer">MAIL DISCLAIMER</a> <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 href="mailto:noPoll@lists.aspl.es">noPoll@lists.aspl.es</a><o:p></o:p></pre>
<pre><a 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>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%">
<tbody>
<tr>
<td style="padding:0in 0in 0in 0in">
<pre><o:p> </o:p></pre>
<pre>-- <o:p></o:p></pre>
<pre>Francis Brosnan Blázquez <<a href="mailto:francis@aspl.es">francis@aspl.es</a>><o:p></o:p></pre>
<pre>ASPL<o:p></o:p></pre>
<pre>91 134 14 22 - 91 134 14 45 - 91 116 07 57<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>AVISO LEGAL<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>En virtud de lo dispuesto en la Ley Orgánica 15/1999, de 13 de<o:p></o:p></pre>
<pre>diciembre, de Protección de Datos de Carácter Personal, le informamos de<o:p></o:p></pre>
<pre>que sus datos de carácter personal, recogidos de fuentes accesibles al<o:p></o:p></pre>
<pre>público o datos que usted nos ha facilitado previamente, proceden de<o:p></o:p></pre>
<pre>bases de datos propiedad de Advanced Software Production Line, S.L.<o:p></o:p></pre>
<pre>(ASPL).<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>ASPL garantiza que los datos serán tratados con la finalidad de mantener<o:p></o:p></pre>
<pre>las oportunas relaciones comerciales o promocionales con usted o la<o:p></o:p></pre>
<pre>entidad que usted representa. No obstante, usted puede ejercitar sus<o:p></o:p></pre>
<pre>derechos de acceso, rectificación, cancelación y oposición dispuestos en<o:p></o:p></pre>
<pre>la mencionada Ley Orgánica, notificándolo por escrito a ASPL -<o:p></o:p></pre>
<pre>Protección Datos, C/Antonio Suárez 10 A-102, 28802, Alcalá de Henares<o:p></o:p></pre>
<pre>(Madrid).<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
This message is subject to the following terms and conditions: <a href="http://www.barco.com/en/maildisclaimer">
MAIL DISCLAIMER</a>
</body>
</html>