[libmicrohttpd] integration with my websockets

2017-04-11 Thread José Bollo
EPOLL with external threading. Third, do you plan to provide a new version soon? Best regards José Bollo

Re: [libmicrohttpd] integration with my websockets

2017-04-11 Thread José Bollo
On Tue, 11 Apr 2017 18:29:04 +0200 José Bollo wrote: > Hi all, > > I just found time now to integrate the work you did last summer > for upgrading connections. Seems to work out of the box, but... > > First a remark: I was previously trying to allocate ressources for the >

Re: [libmicrohttpd] integration with my websockets

2017-04-11 Thread José Bollo
On Tue, 11 Apr 2017 20:04:37 +0300 Evgeny Grin wrote: > Hi José, > > On 11.04.2017 19:55, José Bollo wrote: > > On Tue, 11 Apr 2017 18:29:04 +0200 > > José Bollo wrote: > > > >> I just found time now to integrate the work you did last summer > >>

Re: [libmicrohttpd] integration with my websockets

2017-04-12 Thread José Bollo
one that way. But now I have to handle 2 function: one for the creation and one for attaching the socket (or the stuff). Because there is a negociation of protocol and thus I use tables, I have to update tables and redesign things. But I'm happy to get a solution from MHD instead of having

[libmicrohttpd] [PATCH] Check response existence on upgrade

2017-05-04 Thread José Bollo
e || NULL == connection->response->upgrade_handler or NULL != connection->response && NULL == connection->response->upgrade_handler The first is prefered because it is probably safer to close the connection in that case. Change-Id: Ie6e7fc165f7fe3635ade0952bb34a0b937d38716 Sig

Re: [libmicrohttpd] [PATCH] Check response existence on upgrade

2017-05-05 Thread José Bollo
On Thu, 4 May 2017 23:36:23 +0300 Evgeny Grin wrote: > Thanks! Applied. > Hello Evgeny, After thinking about the issue, I guess that it is a serious vulnerability. I guess that a simple curl request to a server running 0.52 or 0.53 can raise the SEGV. IMHO if curl http://www.myserver.org/

[libmicrohttpd] issue with suspend/resume

2017-05-05 Thread José Bollo
Hi Was there a change in how suspend/resume works? I observe that responses are no more send after resuming. Best regards José Bollo

Re: [libmicrohttpd] issue with suspend/resume

2017-05-06 Thread José Bollo
On Fri, 5 May 2017 21:09:21 +0300 Evgeny Grin wrote: > Hi José, > > Shouldn't be any change. okay, thank you. > Could you provide minimal example? I'll investigate from Tuesday and will provide further feedback. Best regards José

Re: [libmicrohttpd] issue with suspend/resume

2017-05-10 Thread José Bollo
On Fri, 5 May 2017 21:09:21 +0300 Evgeny Grin wrote: > Hi José, > > Shouldn't be any change. > Could you provide minimal example? > Hi Evgeny, I was busy yesterday but I now have an example showing the regression. I send it attached. I tested it against current master version (917342b3fb05475

Re: [libmicrohttpd] issue with suspend/resume

2017-05-10 Thread José Bollo
On Wed, 10 May 2017 09:31:22 +0200 José Bollo wrote: {snip} > > To circumvent it, you can replace #if 0 with #if 1, leading to call > MHD_run one more time. So there is a workaround. In fact I'am actually enforced to call it 3 times to get all the output because I

Re: [libmicrohttpd] issue with suspend/resume

2017-05-11 Thread José Bollo
On Wed, 10 May 2017 21:57:17 +0300 Evgeny Grin wrote: > On 10.05.2017 10:31, José Bollo wrote: > > On Fri, 5 May 2017 21:09:21 +0300 > > Evgeny Grin wrote: > >> Shouldn't be any change. > >> Could you provide minimal example? > > > > >

Re: [libmicrohttpd] issue with suspend/resume

2017-05-11 Thread José Bollo
On Thu, 11 May 2017 11:07:49 +0300 Evgeny Grin wrote: > You already can try new version from git master. I already tried using git://gnunet.org/libmicrohttpd, SHA 917342b3fb0547523f2b4c6e607bb2ffd9cacdfd as witten in http://lists.gnu.org/archive/html/libmicrohttpd/2017-05/msg00029.html If you

Re: [libmicrohttpd] issue with suspend/resume

2017-05-11 Thread José Bollo
On Thu, 11 May 2017 14:48:52 +0300 Evgeny Grin wrote: First, I just tried the latest commit (787bfd1859db22c58271f287dfcb505c0052edd3): Do not add any "Connection" headers for "upgrade" connections. My issue was still here but... > "At least one time" - correct approach. > May be more calls are

Re: [libmicrohttpd] issue with suspend/resume

2017-05-11 Thread José Bollo
On Thu, 11 May 2017 15:49:43 +0300 Evgeny Grin wrote: > On 11.05.2017 15:26, José Bollo wrote: > > First, I just tried the latest commit > > (787bfd1859db22c58271f287dfcb505c0052edd3): Do not add any > > "Connection" headers for "upgrade" connecti

Re: [libmicrohttpd] issue with suspend/resume

2017-05-12 Thread José Bollo
On Thu, 11 May 2017 22:56:58 +0300 Evgeny Grin wrote: > Hi José, > > On 11.05.2017 16:13, José Bollo wrote: > >>> First, I just tried the latest commit > >>> (787bfd1859db22c58271f287dfcb505c0052edd3): Do not add any > >>> "Connection" head

[libmicrohttpd] Advise about upgrade "facility"

2018-03-16 Thread José Bollo
1 for testing the case and adapt my code? #define MHD_VERSION 0x00095901 - in my case, the resource is not used and was released in the upgrade callback. Is there a way to force the con_cls of a connection? If yes I can release the resources earlier. Best regards José Bollo

Re: [libmicrohttpd] Web Socket disconnect behaviour

2018-10-11 Thread José Bollo
; Hello Sylvio, I'm using LMHD for websocket-ing. I point you a central file that may help (or not -hope to not confuse you-). https://git.automotivelinux.org/src/app-framework-binder/tree/src/afb-websock.c Best regards José Bollo > Thank you! > > On Wed, Sep 5, 20

[libmicrohttpd] MHD_add_connection and EPOLL

2018-10-30 Thread José Bollo
and MHD_USE_NO_LISTEN_SOCKET together is unsupported. So it doesn't work. listen_fd is -1 always. I think that my expectation is valuable. Do you agree? Best regards José Bollo

Re: [libmicrohttpd] MHD_add_connection and EPOLL

2018-10-30 Thread José Bollo
On Tue, 30 Oct 2018 15:51:19 +0100 José Bollo wrote: > Hi, > > I try to add the selection of the interfaces to serve on MHD. I was > using MHD_USE_EPOLL and was managing to include the epoll in the > external main loop with MHD_get_daemon_info(daemon, > MHD_DAEMON_INFO_E

Re: [libmicrohttpd] Web Socket disconnect behaviour

2018-10-30 Thread José Bollo
eanup. Are you volunteer? > Thank you for sharing! You are welcome. I just hope your trial will be successful easily. Best regards José > On Thu, Oct 11, 2018 at 4:22 AM José Bollo wrote: > > > On Mon, 8 Oct 2018 23:41:02 -0300 > > silvioprog wrote: > > > > &

Re: [libmicrohttpd] MHD_add_connection and EPOLL

2018-10-31 Thread José Bollo
On Tue, 30 Oct 2018 16:07:50 +0100 José Bollo wrote: just to be sure that you dont miss the patch (tested with success here) > The patch below seems okay: > > > diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c > index cd2ca189..b877e560 100644 > --- a/src/m

[libmicrohttpd] improvement in HTTPS option parsing

2018-12-04 Thread José Bollo
please find attached a patch that allows to set/unset MHD_USE_TLS without being enforced to add/remove HTTPS options. Best regards José Bollo From b36db063495a1d2e185a491f42560294fe88ba33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Bollo?= Date: Tue, 4 Dec 2018 15:45:12 +0100 Subject

Re: [libmicrohttpd] Chunked encoding POST getting a 411 error

2019-01-24 Thread José Bollo
On Thu, 24 Jan 2019 05:22:35 +0100 Christian Grothoff wrote: > You're not incorrect, but likely the first one to try this. I don't > recall anyone ever implementing this feature for uploads. Is there a > good reason why you need it? Usually clients telling the server > up-front how big the upload

Re: [libmicrohttpd] websocket example

2019-01-30 Thread José Bollo
On Tue, 29 Jan 2019 16:16:59 +0100 Moritz Warning wrote: > Hi, > > can someone point me to an example of using websockets with > libmicrohttpd? > > thanks, > mwarning > I implemented WS over LMHD. Try to pull starting from function check_websocket_upgrade in https://git.automotivelinux.org/sr

Re: [libmicrohttpd] websocket example

2019-01-30 Thread José Bollo
many dependencies). The work is not so hard but it is to be made. But it is a recurrent question. So a tiny implementation could help. I'll try to isolate some essential code and provide something more useful. When? I'll try to do it soon. Best regards José > > best, > > On

[libmicrohttpd] tiny websocket above LMHD

2019-02-01 Thread José Bollo
linux. People on Mac or BSD are welcome to submit issues or pull requests. People of windows also of course. Best regards José Bollo

Re: [libmicrohttpd] websocket example

2019-02-01 Thread José Bollo
it. Best regards José > > best, > > On Wed, Jan 30, 2019 at 4:17 PM José Bollo wrote: > > > I implemented WS over LMHD. Try to pull starting from function > > check_websocket_upgrade in > > > > https://git.automotivelinux.org/src/app-framework-binder

Re: [libmicrohttpd] tiny websocket above LMHD

2019-02-05 Thread José Bollo
t; > > But, I have two questions: is it very difficult to do a minimal WS > > example to distribute in the MHD examples? If so, will mark the > > #5501 <https://gnunet.org/bugs/view.php?id=5501> as 'won't fix' and > > close the issue. The other ques

Re: [libmicrohttpd] tiny websocket above LMHD

2019-02-12 Thread José Bollo
https://gitlab.com/jobol/lmhd-ws/issues>? If so, > I'll open a new issue as feature-request to build the library on > Windows using the MSYS2 tools http://www.msys2.org . Hello Sylvio, an issue is very welcome. > Thank you! (y) > > On Tue, Feb 5, 2019 at 6:56 AM José Bo

Re: [libmicrohttpd] tiny websocket above LMHD

2019-02-12 Thread José Bollo
open a new issue as feature-request to build the library on > > Windows using the MSYS2 tools http://www.msys2.org . > > > > Thank you! (y) > > > > On Tue, Feb 5, 2019 at 6:56 AM José Bollo wrote: > > > >> On Sun, 3 Feb 2019 22:35:13 -0300 > >>

[libmicrohttpd] regression since commit cc5032b85

2019-07-25 Thread José Bollo
commit cc5032b85, it always returns NULL because the 2nd parameter is no more treated as a bit mask. My feeling is that bit mask was cool to have but it is up to you to decide how to follow up. Best regards José Bollo

[libmicrohttpd] running in main thread

2019-12-02 Thread José Bollo
g except ctrl+C or killed. It leads me to the question: "is there an easy way to serve in main thread?" (by easy I mean without rewriting an external polling loop as shown in example fileserver_example_external_select.c) Did I missed some option? Best regards José Bollo

Re: [libmicrohttpd] running in main thread

2019-12-02 Thread José Bollo
On Mon, 2 Dec 2019 15:04:52 +0100 José Bollo wrote: rereading comment of MHD_USE_INTERNAL_POLLING_THREAD my question looks stupid sorry for the noise > Hi all, > > I searched in examples how to "block" in main thread on serving files > but I only found examples with t

Re: [libmicrohttpd] running in main thread

2019-12-02 Thread José Bollo
On Mon, 2 Dec 2019 15:08:39 +0100 José Bollo wrote: > On Mon, 2 Dec 2019 15:04:52 +0100 > José Bollo wrote: > > rereading comment of MHD_USE_INTERNAL_POLLING_THREAD my question looks > stupid No in fact the question is serious. There is no simple way to let run MHD on the

Re: [libmicrohttpd] running in main thread

2019-12-02 Thread José Bollo
On Mon, 2 Dec 2019 17:41:09 +0100 Christian Grothoff wrote: > On 12/2/19 4:49 PM, José Bollo wrote: > > On Mon, 2 Dec 2019 15:08:39 +0100 > > José Bollo wrote: > > > >> On Mon, 2 Dec 2019 15:04:52 +0100 > >> José Bollo wrote: > >> > >>

Re: [libmicrohttpd] running in main thread

2019-12-02 Thread José Bollo
On Mon, 2 Dec 2019 22:03:51 +0100 Christian Grothoff wrote: > On 12/2/19 9:55 PM, José Bollo wrote: > > > > I tried to write something like "while(true) MHD_run();" but strace > > showed its inefficiency. > > Oh my. Yes, that'd be bad. > > >

[libmicrohttpd] upgrading and life cycle of sockets

2020-11-24 Thread José Bollo
Hi there, After a switching protocol for web socket for example, libmicrohttp keeps the socket under the table until a call to MHD_upgrade_action (something, MHD_UPGRADE_ACTION_CLOSE). So, it enforces to have a link to libmicrohttp when using such switched protocol socket. Is it possible to brea

Re: [libmicrohttpd] upgrading and life cycle of sockets

2020-11-24 Thread José Bollo
re what I'm missing? > Happy hacking! > > Christian > > On 11/24/20 3:23 PM, José Bollo wrote: > > Hi there, > > > > After a switching protocol for web socket for example, libmicrohttp > > keeps the socket under the table until a call to MHD_upgrade

Re: [libmicrohttpd] upgrading and life cycle of sockets

2020-11-24 Thread José Bollo
On Tue, 24 Nov 2020 16:01:48 +0100 Christian Grothoff wrote: > On 11/24/20 3:48 PM, José Bollo wrote: > > On Tue, 24 Nov 2020 15:34:03 +0100 > > Christian Grothoff wrote: > > > >> Hi Jose, > >> > >> Well, technically you can dup() around this

Re: [libmicrohttpd] upgrading and life cycle of sockets

2020-11-25 Thread José Bollo
On Tue, 24 Nov 2020 23:12:43 +0100 Christian Grothoff wrote: > On 11/24/20 4:50 PM, José Bollo wrote: > > What about if in some future an option to MHD_upgrade_action would > > enable to "extract" the socket? Something like: > > > > MHD_upgrade_actio

Re: [libmicrohttpd] upgrading and life cycle of sockets

2020-11-26 Thread José Bollo
On Thu, 26 Nov 2020 12:38:24 +0100 Christian Grothoff wrote: > On 11/26/20 8:31 AM, José Bollo wrote: > > On Tue, 24 Nov 2020 23:12:43 +0100 > > Christian Grothoff wrote: > > > >> On 11/24/20 4:50 PM, José Bollo wrote: > >>> What about if in s

Re: [libmicrohttpd] upgrading and life cycle of sockets

2020-11-26 Thread José Bollo
On Thu, 26 Nov 2020 13:19:51 +0100 Christian Grothoff wrote: > On 11/26/20 1:14 PM, José Bollo wrote: > >> For child processes, not really: you can even do the dup()ing only > >> after fork() if you manually clear the close-on-exec flag. So you > >> don't ne

[libmicrohttpd] upgrading and life cycle of sockets, issue when used with epoll

2020-12-10 Thread José Bollo
regards José Bollo #include #include #include #include #include #include #include #include #include #include / SHA / #define SHA1_DIGEST_LENGTH 20 /* The SHA1 structure: */ typedef struct { uint32_t state[5]; uint64_t length; union

Re: [libmicrohttpd] upgrading and life cycle of sockets, issue when used with epoll

2020-12-30 Thread José Bollo
08:18 +0100 José Bollo wrote: > Hello, > > My code uses LMHD embedded with its EPOLL mechanism. Part of that code > deals with upgrading to websocket. It then call somewhere: > > response = MHD_create_response_for_upgrade( >upgrade_to_websocket, memo); >

Re: [libmicrohttpd] upgrading and life cycle of sockets, issue when used with epoll

2021-01-05 Thread José Bollo
ise, lets go for handling specifically the squared corner case of the wheel. Hopefully I convinced you. Best regards José > > > Happy hacking! > > Christian > > On 12/10/20 4:08 PM, José Bollo wrote: > > Hello, > > > > My code uses LMHD embedded with its EPO

Re: [libmicrohttpd] upgrading and life cycle of sockets, issue when used with epoll

2021-01-07 Thread José Bollo
h operations later based on > other things in your external event loop, you will need some kind of > signalling. > > Happy hacking! > > Christian > > On 1/5/21 10:17 AM, José Bollo wrote: > > On Sun, 3 Jan 2021 14:22:25 +0100 > > Christian Grothoff wrote: > >

[libmicrohttpd] race condition on 0.9.73

2021-09-23 Thread José Bollo
Hi, My program sends answers in threads and runs the main MHD loop on external event in an other thread and I get crashes. I'm suspecting LMHD because valgrind point out that the memory for response is used after free in a kind of race condition between internals of MHD. Is it a known issue fixed

Re: [libmicrohttpd] race condition on 0.9.73

2021-09-23 Thread José Bollo
On Thu, 23 Sep 2021 18:14:24 +0300 Evgeny Grin wrote: > Hi José, Hi Evgeny, > For sure you can run MHD with "external poll" mode, but you must > ensure that only single thread is calling MHD_run() at any given > moment of time. Okay, that is a good hint, thanks. I'm going to first track concur

Re: [libmicrohttpd] race condition on 0.9.73

2021-09-23 Thread José Bollo
On Thu, 23 Sep 2021 19:57:23 +0300 Evgeny Grin wrote: > On 23.09.2021 18:43, José Bollo wrote: > >> For sure you can run MHD with "external poll" mode, but you must > >> ensure that only single thread is calling MHD_run() at any given > >> moment of ti

Re: [libmicrohttpd] race condition on 0.9.73

2021-09-24 Thread José Bollo
On Thu, 23 Sep 2021 18:12:39 +0200 Markus Doppelbauer wrote: > > ... because valgrind point out ... > > You should replace (slow) valgrind with (fast) address-sanatizer. > Simply tell GCC (or clang) to compile with: -fsanitize=address -fno- > omit-frame-pointer > Thank you Markus for the

Re: [libmicrohttpd] race condition on 0.9.73

2021-09-24 Thread José Bollo
Hi Evgeny, Hi all, Firstly, protecting MHD_run made the job, the crash disappears and valgrind is happy. Thank you for that efficient support. Secundly, I'm still seeing and investigating an issue. Sometime, the queued response (MHD_queue_response) is not sent. Here again, I think that it is a ra

Re: [libmicrohttpd] race condition on 0.9.73

2021-09-24 Thread José Bollo
Sep 2021 14:56:36 +0200 José Bollo wrote: > Hi Evgeny, Hi all, > > Firstly, protecting MHD_run made the job, the crash disappears and > valgrind is happy. Thank you for that efficient support. > > Secundly, I'm still seeing and investigating an issue. Sometime

Re: [libmicrohttpd] race condition on 0.9.73

2021-09-28 Thread José Bollo
On Sat, 25 Sep 2021 17:35:42 +0300 Evgeny Grin wrote: > Hi José, > > Thanks for the report! > > If MHD needs to (re-)run MHD_run() immediately MHD_get_timeout() must > return zero timeout. > You don't need to re-run it if no timeout is returned. > Zero timeout if connection cleanup is pending

Re: [libmicrohttpd] [PATCH] MHD_add_response_header: Check on passed nullptr

2022-01-28 Thread José Bollo
On Fri, 28 Jan 2022 11:15:20 +0100 Christian Grothoff wrote: > That is something you cannot guarantee in C, basically ever. Libraries > always require that they are called with correct arguments. Sure, a > NULL pointer could be detected, but calling a function with a NULL > pointer that is not d

[libmicrohttpd] upgrading connection

2016-04-20 Thread José Bollo
o you agree that the use of suspend/resume is a good idea? If yes, the patch should be upstreamed to avoid the closing of the connection when "connection: upgrade\r\n" appears. Best regards José Bollo

Re: [libmicrohttpd] upgrading connection

2016-04-20 Thread José Bollo
Le mercredi 20 avril 2016 à 18:03 +0300, Evgeny Grin a écrit : > > On 20.04.2016 15:28, José Bollo wrote: > > I implement web-socket upgrading and it worked very well with firefox. > > The bad happens when I use Chromium. The following little patch of the > > function

Re: [libmicrohttpd] upgrading connection

2016-04-20 Thread José Bollo
Le Wed, 20 Apr 2016 20:42:48 +0300, Evgeny Grin a écrit : > > > > Forwarded Message > Subject: Re: [libmicrohttpd] upgrading connection > Date: Wed, 20 Apr 2016 19:48:53 +0300 > From: Evgeny Grin > To: libmicrohttpd@gnu.org > > > > O

Re: [libmicrohttpd] suspend/resume patch

2016-05-17 Thread José Bollo
appen on the connection and here yes, I can imagine a leak. But it is IMHO the only case. Please could check again whether the following patch that avoid to close the connection when upgrade is called is valid or not. Best regards José Bollo diff -Naur a/src/microhttpd/connection.c b/src/microh

Re: [libmicrohttpd] suspend/resume patch

2016-05-17 Thread José Bollo
Le mardi 17 mai 2016 à 13:38 +0200, Christian Grothoff a écrit : > Done as of SVN 37180. Hi, I sew that client of libmicrohttpd can now obtain the suspended/resume state of a connection. > I'll try to get to the rest of your e-mail later. Impatient to read yiu. Best regards

Re: [libmicrohttpd] suspend/resume patch

2016-05-29 Thread José Bollo
Le dimanche 29 mai 2016 à 20:53 +0200, Christian Grothoff a écrit : > On 05/17/2016 09:53 AM, José Bollo wrote: > > > > Le mercredi 20 avril 2016 à 20:41 +0300, Evgeny Grin a écrit : > > Please could check again whether the following patch that avoid to > > close the

Re: [libmicrohttpd] suspend/resume patch

2016-06-16 Thread José Bollo
Le dimanche 29 mai 2016 à 20:53 +0200, Christian Grothoff a écrit : > On 05/17/2016 09:53 AM, José Bollo wrote: > > > > Le mercredi 20 avril 2016 à 20:41 +0300, Evgeny Grin a écrit : > > Please could check again whether the following patch that avoid to > > close the

Re: [libmicrohttpd] suspend/resume patch

2016-07-27 Thread José Bollo
PING I still think that the patch is a need. In src/microhttpd/connection.c -if ( (MHD_str_equal_caseless_ (end, "close")) || - (MHD_str_equal_caseless_ (end, "upgrade")) ) +if ( (MHD_str_equal_caseless_ (end, "close")) ) Best regards José Bollo

Re: [libmicrohttpd] Query on using openssl with microhttpd

2016-08-05 Thread José Bollo
Le vendredi 05 août 2016 à 20:19 +0530, Geetha Shanmugam a écrit : > Hi,  > Is there a way we can use openssl library (instead of gnutls) with > microhttpd?  very good question (but I can't answer)

Re: [libmicrohttpd] suspend/resume patch

2016-08-29 Thread José Bollo
to the header connection?  2- should the connection be close (or conversely should it be kept alive) Best regards. José Bollo diff -Naur a/src/microhttpd/connection.c b/src/microhttpd/connection.c --- a/src/microhttpd/connection.c 2016-04-08 21:02:26.0 +0200 +++ b/src/microhttpd/connection.c 2016-

Re: [libmicrohttpd] Connection: Upgrade / WebSockets

2016-09-04 Thread José Bollo
sure if this does everything we need. > > > Thus, if you are interested in this functionality, please: Yes I am. > * try it now, check if the API does what you need and if not, >   let me know! > * test it now, that way once we put it into a release we will >   likely have a more stable API and implementation! I'll try to give you feedback around mid september. Best regards José Bollo

Re: [libmicrohttpd] Clarification on receiving on one thread, replying on another

2016-10-25 Thread José Bollo
This topic is very interesting. Is it the same issue when an external select/poll is used? Best regards José Bollo Le mardi 25 octobre 2016 à 11:45 -0400, Tom Cornell a écrit : > On Tue, Oct 25, 2016 at 04:11:12PM +0200, Christian Grothoff wrote: > > > > On 10/25/2016 03:59