Re: [libmicrohttpd] Can I define variable of char array for a page in the function containing MHD_create_response_from_buffer with the flag of MHD_RESPMEM_PERSISTENT

2022-11-17 Thread Viktor Paramonov
Dear Christian Could you, please, remove my e-Mail address from this distribution list? Thanks in advance Viktor On Thu, 17 Nov 2022 at 17:10, Christian Grothoff wrote: > On 11/17/22 14:24, lingweicai via libmicrohttpd wrote: > > Hello Experts, > > > > > > I am developing a web tool, Can I def

Re: [libmicrohttpd] Zero copy MHD_create_response_from_callback

2022-11-17 Thread Dan Inve
Hi Christian, Sounds like you should be using MHD_create_response_from_iovec(). That > way, you can avoid the memcpy() entirely. > I took a look at MHD_create_response_from_iovec, but I'm not sure if that works for my circumstance because it doesn't use a callback. The data from the driver isn't

Re: [libmicrohttpd] Can I define variable of char array for a page in the function containing MHD_create_response_from_buffer with the flag of MHD_RESPMEM_PERSISTENT

2022-11-17 Thread Christian Grothoff
On 11/17/22 14:24, lingweicai via libmicrohttpd wrote: Hello Experts, I am developing a web tool, Can I define variable of char array for a page in the function containing MHD_create_response_from_buffer, with flag of MHD_RESPMEM_PERSISTENT? or I must use the flag of MUST_COPY ? for example:

[libmicrohttpd] Can I define variable of char array for a page in the function containing MHD_create_response_from_buffer with the flag of MHD_RESPMEM_PERSISTENT

2022-11-17 Thread lingweicai via libmicrohttpd
Hello Experts, I am developing a web tool, Can I define variable of char array for a page in the function containing MHD_create_response_from_buffer, with flag of MHD_RESPMEM_PERSISTENT? or I must use the flag of MUST_COPY ? for example: send_page ( char * str ) {char page[1024];strcpy ( pa

Re: [libmicrohttpd] Zero copy MHD_create_response_from_callback

2022-11-17 Thread Christian Grothoff
Dear Dan, Sounds like you should be using MHD_create_response_from_iovec(). That way, you can avoid the memcpy() entirely. Happy hacking! Christian On 11/17/22 08:27, Dan Inve wrote: Hi, I'm using libmicrohttpd to respond to an HTTP request for a large amount of data (sometimes GBs) using

[libmicrohttpd] Zero copy MHD_create_response_from_callback

2022-11-17 Thread Dan Inve
Hi, I'm using libmicrohttpd to respond to an HTTP request for a large amount of data (sometimes GBs) using external select and MHD_create_response_from_callback with a known size. The data is sourced from hardware via a kernel driver. When the HTTP request is received, data is requested from the h

[libmicrohttpd] Zero copy MHD_create_response_from_callback

2022-11-17 Thread Dan Inve
Hi, I'm using libmicrohttpd to respond to an HTTP request for a large amount of data (sometimes GBs) using external select and MHD_create_response_from_callback with a known size. The data is sourced from hardware via a kernel driver. When the HTTP request is received, data is requested from the h