Git Product home page Git Product logo

marmaladehttputils's Introduction

HttpUtils for Marmalade

A Marmalade-friendly wrapper around libcurl. HttpClient will automatically spawn and manage worker threads to allow fast parallel downloads.

Usage & Example

For general usage info, see the example in HttpUtils.cpp

You can also subclass HttpClient and/or HttpRequest to create things like:

  • A file downloader
  • A YouTube API Client (example included in the youtube folder)
  • A client for your custom API
  • etc.

Or, you can use the included HttpClient or HttpDownloader for basic GET/POST/PUT requests.

HTTPS Support

HTTPS support is included and enabled, however it will not work out of the box unless you correctly configure OpenSSL/CURL to be able to verify the certificates of the server[s] you use. See HttpClient_WorkerThread() in HttpClient.cpp for a comment describing how to disable certificate checks if you want a quick-and-dirty insecure way to test an HTTPS connection.

Curl patch notes

This includes a patched version of libcurl 7.34.0.

The patch is applied to source/http.c line 2425 in Curl_http():

// Due to an unfortunate bug with Marmalade, any attempt to pass
// "long long" types like curl_off_t as a variadic parameter
// corrupt the value on GCC ARM RELEASE builds on iOS.
// So we have to downcast to an int and hope the user is not trying
// any really large files (over 4GB)
unsigned long int size_fix = (unsigned long int)postsize;
result = Curl_add_bufferf(req_buffer, "Content-Length: %ld\r\n",
                          size_fix);
//result = Curl_add_bufferf(req_buffer,
//                          "Content-Length: %" FORMAT_OFF_T"\r\n",
//                          postsize);

License

Most original files here are public domain. But check inside each file/folder as the licenses and copyrights vary. All are suitable for use in commercial projects, however.

marmaladehttputils's People

Contributors

bradenmacdonald avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

oldpulteney

marmaladehttputils's Issues

recompiling the CURL subproject (marmalde OSX XCode)

Thanks so much for this repo. It's been really help for getting some work implemented in one of my projects. I know it's been a while since anyone looked at it but I'm having a problem.

Currently the libcurl build included doesn't have a lib binary for arm64. Since the subproject is included I didn't think this would be a problem. I thought I could fire up the MKB of the subproject, switch to GCC ARCH64 and chase down any lingering type size problems.

The problem I'm having is that no matter which compiler I choose, Im getting the same 2 errors,

MarmaladeHttpUtils/subprojects/curl/source/urldata.h:1420:3: Unknown type name 'curl_xferinfo_callback'

MarmaladeHttpUtils/subprojects/curl/source/urldata.h:1642:30: Field has incomplete type 'struct curl_tlssessioninfo'

Now both of these are defined in curl/curl.h which is included in urldata.h on line 175. Can anyone there see what I'm doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.