[Libwebsockets] LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION ends up in refusing connection

Andy Green andy at warmcat.com
Thu Aug 7 09:47:14 CEST 2014



On 7 August 2014 15:05:24 GMT+08:00, Prathamesh P Ghanekar <prathamesh.ghanekar at igate.com> wrote:
>Yes, But why am I not able to hit CONNECTION_ESTABLISHED reason?I tried
>putting non-zero return value inside

I think you mean "zero return value".

>LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION, but it just returns and waits
>for next events.

Well only you can see your code.

Did you do what I suggested?

>Check your callback's response to unknown reasons.... it should always
>return 0 like the test samples do.

I mean if it is a switch(), there should be something like

default:
        return 0;

-Andy

>Prathamesh
>
>-----Original Message-----
>From: Andy Green [mailto:extracats at googlemail.com] On Behalf Of Andy
>Green
>Sent: 07 August 2014 12:21
>To: Prathamesh P Ghanekar; libwebsockets at ml.libwebsockets.org
>Subject: Re: LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION ends up in
>refusing connection
>
>
>
>On 7 August 2014 14:01:07 GMT+08:00, Prathamesh P Ghanekar
><prathamesh.ghanekar at igate.com> wrote:
>>Hi,
>>
>>I am trying to open a websocket connection from a javascipt client. I 
>>have been successfully able to do so, in the past. But now, I am faced
>
>>with this error.
>>WARN: User code denied connection
>>And the value of 'reason' that I get is 
>>LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION.
>
>The only way to get that problem is return nonzero from the callback.
>
>Check your callback's response to unknown reasons.... it should always
>return 0 like the test samples do.
>
>That way if you don't deal with the callback, it does the default, sane
>action.
>
>-Andy
>
>>I looked up in the documentation that this value corresponds to the 
>>handling of headers.But, I don't need any such handling.
>>So, can you please tell me why am I not able to hit 
>>LWS_CONNECTION_ESTABLISHED inside my calback?
>>
>>Thanks and regards,
>>Prathamesh
>>
>>
>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Disclaimer~~~
>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>Information contained and transmitted by this e-mail is confidential 
>>and proprietary to IGATE and its affiliates and is intended for use 
>>only by the recipient. If you are not the intended recipient, you are 
>>hereby notified that any dissemination, distribution, copying or use
>of 
>>this e-mail is strictly prohibited and you are requested to delete
>this 
>>e-mail immediately and notify the originator or mailadmin at igate.com 
>><mailto:mailadmin at igate.com>. IGATE does not enter into any agreement 
>>with any party by e-mail. Any views expressed by an individual do not 
>>necessarily reflect the view of IGATE. IGATE is not responsible for
>the 
>>consequences of any actions taken on the basis of information
>provided, 
>>through this email. The contents of an attachment to this e-mail may 
>>contain software viruses, which could damage your own computer system.
>>While IGATE has taken every reasonable precaution to minimise this 
>>risk, we cannot accept liability for any damage which you sustain as a
>
>>result of software viruses. You should carry out your own virus checks
>
>>before opening an attachment. To know more about IGATE please visit 
>>www.igate.com <http://www.igate.com>.
>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Disclaimer~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Information contained and transmitted by this e-mail is confidential
>and proprietary to IGATE and its affiliates and is intended for use
>only by the recipient. If you are not the intended recipient, you are
>hereby notified that any dissemination, distribution, copying or use of
>this e-mail is strictly prohibited and you are requested to delete this
>e-mail immediately and notify the originator or mailadmin at igate.com
><mailto:mailadmin at igate.com>. IGATE does not enter into any agreement
>with any party by e-mail. Any views expressed by an individual do not
>necessarily reflect the view of IGATE. IGATE is not responsible for the
>consequences of any actions taken on the basis of information provided,
>through this email. The contents of an attachment to this e-mail may
>contain software viruses, which could damage your own computer system.
>While IGATE has taken every reasonable precaution to minimise this
>risk, we cannot accept liability for any damage which you sustain as a
>result of software viruses. You should carry out your own virus checks
>before opening an attachment. To know more about IGATE please visit
>www.igate.com <http://www.igate.com>.
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




More information about the Libwebsockets mailing list