|
From: | Ajay Bhargav (SiWi) |
Subject: | Re: [lwip-users] Download a file for firmware upgrade |
Date: | Mon, 21 May 2018 18:24:53 +0530 |
The minimalistic Get request I mentioned uses HTTP 1.0 not 1.1 because as you go to HTTP v1.1 server may send chunked encoding which is hard to decode and handle unless you use a good processing library something like: https://github.com/h2o/picohttpparser.git I used this parser in one of my project and it works great handling chunked encoding or any kind of HTTP response. But Since your requirement is simpler enough, I would suggest you stick with HTTP v1.0 and send get request as I mentioned. You will also get Content-Length in header which tells you size of file being downloaded. Regards, Ajay Bhargav From: Giuseppe Modugno Il 21/05/2018 14:26, Sergio R. Caprile ha scritto: > You can do whatever you want. > The question is probably not what can you do but what do you have > available to obtain what you need with lesser effort. > There are FTP clients around, I've collaborated in one of them using the > RAW API, search the list. > FTP is sometimes tricky and can give you some headaches with firewalls > (and/or admins). > For HTTP you need a client. I wouldn't just GET and hope everything is > fine unless I can manage both ends (that means: the server too) and > guarantee there won't be other stuff than my file. I couldn't understand your concerns about a minimalistic HTTP client that opens that TCP connection, sends the GET request and wait for the response (as Ajay suggested). > A HTTP client can be quite complicated, but you just need to get one > resource at a specific URI I know a full HTTP client is a very complex piece of code, but I only need to download a specific URI. > You can even have a proprietary protocol running over TCP or UDP. If > your device will be sold and installed on corporate networks, you might > raise some concern among the net admins, asking to have open holes in > the firewall does not seem to be a good way to make friends. I know, but I'd prefer to avoid this approach. > My bet is to go for the user to upload the file, leveraging your web > server; This is a good suggestion. However the original question arises again: how to upload a file to the Web server? Should I use _javascript_/jQuery to choose and send a local file to httpd through POST method (that I'm not actually using)? > but if you must go out and get it, then perhaps FTP is the > easiest full client and HTTP is the simplest firewall piercing. I think a minimalistic HTTP GET request should be enough. > I don't > know if there are running clients around. Particularly for your API, > which you don't say. (I'm intentionally not considering TFTP for going > out because of the possible firewall issue, but if it is your network, > there is a client already available) No, the firmware binary file will be on the public Internet and the device will be behind a NAT router... usually. _______________________________________________ lwip-users mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/lwip-users |
[Prev in Thread] | Current Thread | [Next in Thread] |