[Libwebsockets] [EXTERNAL] Re: how to use LWSMPRO_CALLBACK

Avigail Wilk awilk at kramerav.com
Tue Jun 22 10:08:32 CEST 2021


Thanks for your quick response. 
I changed the name of http protocol but still have the same behavior.

I traced the two different ways -
When I use LWSMPRO_CALLBACK:
LWS_CALLBACK_HTTP_BIND_PROTOCOL
LWS_CALLBACK_CHECK_ACCESS_RIGHTS
LWS_CALLBACK_HTTP
LWS_CALLBACK_HTTP_WRITEABLE
LWS_CALLBACK_HTTP_WRITEABLE
LWS_CALLBACK_HTTP_DROP_PROTOCOL
LWS_CALLBACK_CLOSED_HTTP
LWS_CALLBACK_WSI_DESTROY
  
When I use  LWSMPRO_FILE:
LWS_CALLBACK_HTTP
LWS_CALLBACK_HTTP_BODY
LWS_CALLBACK_HTTP_BODY_COMPLETION
LWS_CALLBACK_HTTP_WRITEABLE
LWS_CALLBACK_HTTP_BIND_PROTOCOL
LWS_CALLBACK_HTTP_DROP_PROTOCOL
LWS_CALLBACK_CLOSED_HTTP
LWS_CALLBACK_WSI_DESTROY

I am attaching a full trace of both mounts.

Let me add, that I upgraded libwebsockets from v2.0 to v4.2.0, and in v2.0 all requests worked as expected.

Thanks again for your support!

-----Original Message-----
From: Andy Green <andy at warmcat.com> 
Sent: Monday, June 21, 2021 3:05 PM
To: Avigail Wilk <awilk at kramerav.com>; libwebsockets at ml.libwebsockets.org
Subject: [EXTERNAL] Re: how to use LWSMPRO_CALLBACK



On 6/21/21 12:07 PM, Avigail Wilk wrote:
> Hi,
>
> I am using libwebsockets v4.2.0.
>
> I want to serve all the HTTP requests through my own callback, so 
> therefor I used  LWSMPRO_CALLBACK in the mounts:

>
> Where "http-only" is the name of http protocol.

> And the multi-part posted completed as expected.
>
> Do you have any idea of what I am doing wrong?

Missing callbacks while everything proceeds can be to do with binding to the wrong protocol... lws itself has a built-in protocol "http-only"
maybe try a different name

https://libwebsockets.org/git/libwebsockets/tree/lib/core-net/vhost.c?h=main

if that's not it maybe you can trace what lws does the two different ways.

-Andy
CAUTION:This email originated from outside of the organization.
Do not click links or open attachments unless you recognize the sender and know the content is safe.



This message has been scanned for malware by Websense. www.websense.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: LWSMPRO_FILE.txt
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20210622/04500159/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: LWSMPRO_CALLBACK.txt
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20210622/04500159/attachment-0003.txt>


More information about the Libwebsockets mailing list