[SOLVED] Send a request to a http server without using sockets.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was thinking if is it possible to implement a http client in u-boot that will download firmware files from the http server. U-boot only supports udc protocol. Correct me if I'm wrong, http takes place in tcp/ip sockets. I'm not sure if it can perform request using the udc protocol but as far as I have researched, it is not possible. In addition, u-boot has no socket support. I would really appreciate any advice about my issue.
U-Boot has support for UDP over IP (but not TCP/IP). TFTP (Trivial File Transfer Protocol) was practically designed for this; it uses UDP/IP, and is supported by U-Boot. Is there a reason why you don't want to use TFTP?
TCP/IP requires quite a complex stack. Many of the implementations intended for embedded devices are quite restricted, for example to four TCP sockets total, with severe limitations on in-flight packets -- thus, very slow transfer rates. HTTP/1.1 is even more complex, especially if you want to communicate with arbitrary HTTP servers; in particular, the response may or may not be chunked. You can avoid most of those issues by using HTTP/1.0, but if the connection is via a proxy, further complications may occur. All it means is that the TCP/IP+HTTP stack is a complex beast, and definitely not suited in an embedded boot loader.
Last edited by Nominal Animal; 07-11-2011 at 04:33 AM.
Reason: A wild duplicate appears!
@Nominal Animal - Thank you for the detailed reply.
"Is there a reason why you don't want to use TFTP?" - I am already using the TFTP protocol. I have my TFTP server and client up and working.
As far as I have researched, I would totally agree with your statement here -> "All it means is that the TCP/IP+HTTP stack is a complex beast, and definitely not suited in an embedded boot loader." I just wanted to know if it is propable to implement an HTTP type of client in a bootloader for file transport/file download. I think it is but it would just be too complex without sockets. TFTP is really suited for automated transfer for bootfiles between my reference board and my host pc.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.