lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] HTTPD POST usage help and clarification


From: Mário Luzeiro
Subject: Re: [lwip-users] HTTPD POST usage help and clarification
Date: Fri, 11 Oct 2019 15:01:04 +0000

another question on this topic.

These are the 3 functions for handling the post
err_t httpd_post_begin(void *connection, const char *uri, const char 
*http_request,
                       u16_t http_request_len, int content_len, char 
*response_uri,
                       u16_t response_uri_len, u8_t *post_auto_wnd);
err_t httpd_post_receive_data(void *connection, struct pbuf *p);
void httpd_post_finished(void *connection, char *response_uri, u16_t 
response_uri_len);

I am confused about the use of *connection
Is it supposed to handle multiple POST connections at same time?

Then first I got a httpd_post_begin where I identify which URI PORT is called 
and then it calls httpd_post_receive_data, but there is no way to pass that 
information

I mean, for GET, we have the
int fs_open_custom (struct fs_file *file, const char *name) function
and fs_file implements a user defined pextension that we can use to store 
information between open / read / close.

I was looking something like that for POST too.

If it is only one connection at a time is expected, it can be handled by some 
local variables to manage which POST URI it is dealing with.

What is the right approach for this?

Mario Luzeiro

________________________________________
From: lwip-users <lwip-users-bounces+mrluzeiro=address@hidden> on behalf of 
Mário Luzeiro <address@hidden>
Sent: 11 October 2019 13:04
To: address@hidden
Subject: [lwip-users] HTTPD POST usage help and clarification

Hi all,

I'm looking to use POST messages.
I found the lwip/httpd/post_example that I based my implementation.

it works ok so far, but some questions:
- I found in function http_post_rxpbuf the following comment:
"* ATTENTION: The application is responsible for the pbuf now, so don't free 
it!"

Does it mean that httpd_post_receive_data callback should free the pbuff ?
The post_example is not free it.


- I was thinking how does this behave when a POST is uploading data
the function httpd_post_receive_data(void *connection, struct pbuf *p) not sure 
if it tells anything about if all data was received
How should I proceed to implement a progressive handling of data? eg: when a 
file is uploaded.


- Should I have a look on LWIP_HTTPD_POST_MANUAL_WND ?
Is that important for me and how does it work?

Is there ant online source for learning how to use this POST features in LWIP? 
or anyone could clarify me?

Mario Luzeiro
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]