Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing libcurl on iOS 5 as an alternative to NSURLConnection
    primarykey
    data
    text
    <p><em>Update: NSURLConnection now seems to properly support 100-Continue. In any case, <a href="https://stackoverflow.com/a/10657992/366091">this answer</a> contains a link to the script to build libcurl for iOS/OSX.</em></p> <p>I'm having a bit of a hard time with <code>NSURLConnection</code>, given that it doesn't support <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3" rel="nofollow noreferrer">Section 8.2.3</a> of RFC 2616 (HTTP/1.1).</p> <p>Basically the client needs to be able to support sending the header <code>Expect: 100-Continue</code>; after sending the request headers, it <strong>must</strong> wait for a response from the server with the status code <code>100</code> before sending the <code>POST</code>/<code>PUT</code> body.</p> <p>Furthermore, <code>NSURLConnection</code> (and consequently all libs that build on top of it) won't return any response from the server until all data is uploaded - which is a pain since the server may reject the upload right away (invalid credentials, no space, file too large, etc). While it does "work" for small files (content is fully uploaded and delegate method with response is called), on large files instead of getting the error response from the server (which I am <strong>positively sure</strong> is sent), I just get a "Connection failed" error.</p> <p>I know <code>libcurl</code> properly supports the <code>100-Continue</code> spec so I need some help compiling it and getting it up and running on a iOS 5 project.</p> <p>I started with <a href="http://forums.indiegamer.com/showthread.php?22833-Getting-LibCurl-to-work-on-iOs..." rel="nofollow noreferrer">this post</a>(scroll to bottom) but I couldn't get far...</p> <p>Made these changes...</p> <pre><code>export CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 export CFLAGS="-arch armv7 --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk" export CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-cpp-4.2 export AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar ./configure --disable-shared --without-ssl --without-libssh2 --without-ca-bundle --without-ldap --disable-ldap --host=arm-apple-darwin10 --build=arm-apple-darwin10 make clean make ar rv libcurl.armv7.a lib/*.o </code></pre> <p>... but compilation fails with message</p> <pre><code>(...) checking for arm-apple-darwin10-gcc... /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 checking whether the C compiler works... no configure: error: in `/Users/bruno/Downloads/curl-7.21.4': configure: error: C compiler cannot create executables </code></pre> <p>I'm using curl 7.21.4, downloaded from Apple's <a href="http://www.opensource.apple.com/source/curl/curl-68/" rel="nofollow noreferrer">open source site</a>.</p> <p>So, how can I compile curl and use it on a iOS 5 project, preferably with SSL support?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload