uCdot
search uCdot:
 
Embedded Linux and uClinux Developer Forum
 
uCdot
- FAQ
- Dev Boards
- Submit Story
- Submit FAQ
- Submit Dev Board
- Topics
- Authors
- About

- Preferences
- Older Stuff
- Past Polls
- Discussions
- Journals
- Messages

Embedded Linux
Mailing Lists
uClinux-dev (search)
Coldfire (search)
MTD
Microblaze (search)
ELUG
BDM-devel
Blackfin

Embedded Linux
Sites
uClinux.org
uClinux-Dist
uClibc
uClinux Directory
LinuxDevices
ARMulator
uClinux-elf-tools
Colilo
Kernel Archives
H8-uClinux
TLDP
Microblaze uClinux
BDM Tools
SkyEye (emulator)
LOM
SETR live CD
Blackfin uClinux

Embedded Linux
Companies
SecureComputing
SDCS
CodePoet
Arcturus
Cadenux
ARMtwister
uClinux.net
Xiptech
senTec
embedded^cl
Cwlinux
emlix
TimeSys
eSpark Infotech
SSV Embedded Systems
Embedded Minds
PeerSec Networks
Vortech Consulting
swissEmbedded
Synertronixx
Mbedthis Software
.vantronix
Aday
GraceLabs
Pengutronix
metux ITS
Codito Technologies
Firmix Software
PetaLogix
NuDesign
Merritt Technologies
WindRiver
OpenGear
Rubico
Analog Devices
Artila Electronics
Vyatta
Embest Info&Tech
Katalix Systems
WorkWare Systems
Kdev
Intellimetrix
Virtual Cogs
SYSGO
coresystems
ExactCODE
KOAN
EzHomeTech
Linux4biz
Linkodas
Trego
EMBEST
Boardcon
HITEG
FemtoLinux
Prosoft World
Witech
Corewind

 
Simple HTTP Client without 'libcurl' or 'libwww'
Linux Timothy B. Smith (Venturality, Inc.) writes "This is probably the 9999th demonstration of a lightweight HTTP GET client, but if I can make someone else's life easier then so be it!

Our client needed a video playback device that could download new data and content via a massive distribution system that we had been contracted to build. Of course the decision was to use XML and HTTP for all of the data needs. "

The client had built the target hardware. It was our task to implement the software. Our target platform was SigmaDesign's em8561 (ARM) architecture, 4MB of onboard flash and uClinux. So code space was a premium.

The XML implementation was a simple once I had found the TinyXML library (http://www.grinninglizard.com/tinyxml). However, the HTTP client library ended up being a little more problematic than anticipated. I had researched libwww and libcurl. libcurl would compile but provided some fun segmentation faults that I was not interested in debugging. libcurl’s event handling mechanism seemed too pervasive to provide a simple blocking HTTP GET call. After linking with either library, the program file ended 200KB+ fatter. These options were not going to work.

After some thought, the solution was simpler than expected. After a few moments designing the components to build the custom functionality, the resulting code was fairly brief and clean. All that was needed was a sockets class, string class, string splitter class, URL class and the final HttpGet function.

I found a simple Sockets class (PracticalSockets @ http://cs.ecs.baylor.edu/~donahoo/practical/CSocke ts/practical). It is an elegant implementation, BUT it also uses STL. There nothing wrong with STL, but I need to reduce code where ever possible - So I have included a version that I have modified to use a custom lightweight String class. The Splitter class is used for parsing URLs strings and HTTP header data. The URL class is the container for the URL tokens. The HttpGet(char *url, char *file) function is a high level function to download the specified “char *url” to the “char *file”.

Full source @ HttpGet.zip, Enjoy

GnuTLS, GNU SASL and Libgcrypt for uClinux | Introduction to uClinux on Blackfin Virginia Beach  >

 

 
uCdot Login
Nickname:

Password:

[ Create a new account ]

Related Links
  • uClinux
  • http://www.grinninglizard.com/ tinyxml
  • http://cs.ecs.baylor.edu/~dona hoo/practical/CSocke ts/practical
  • HttpGet.zip
  • Timothy B. Smith (Venturality, Inc.)
  • More on Linux
  • Also by davidm
  • This discussion has been archived. No new comments can be posted.
    Simple HTTP Client without 'libcurl' or 'libwww' | Login/Create an Account | Top | 1 comments | Search Discussion
    Threshold:
    The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
    The link to HttpGet.zip is broken (Score:0)
    by Anonymous Coward on Friday November 09, @02:16AM (#543)
    http://www.venturality.com/HttpGet.zip: HTTP Error 404 - File or directory not found Please post a working link. Thanks in advance

    The Embedded Linux and uClinux Developer Forum is hosted by: SnapGear life, n.: That brief interlude between nothingness and eternity.

    [ home | contribute story | older articles | past polls | faq | authors | preferences ]