Catrobat/Catroid — pull request #583 by aried3r (2013-08-09 19:02:02+00:00)
Title: Fix upload of large projects

* Updated http-request to 5.4.1 (necessary for ConnectionFactory)
* Added okhttp 1.1.1
* The fix itself is twofold:
First, I enabled chunked uploading (Tranfser-Encoding: chunked).
This didn't quite work with a 85MB project, I debugged as well as I
could, then tested through a proxy on my dev machine to see the
request headers. As soon as I used a proxy, it worked. So the error
was gone once I tried to take a closer look.
I did not bother trying tcpdump or similar on the phone itself.

Secondly, I tried using OkHttp instead of the normal HttpClient with
http-request, this worked out of the box, even without the proxy. I
then tried to upload the same 85MB project on the production server
which did not work (it aborted after 60 seconds).
Turns out, SPDY is enabled on the production server and OkHttp tries
to use the best available protocol (SPDY). Forcing HTTP 1.1 makes it
work.

Advantages of using OkHttp: It's (supposedly) the best HttpClient
around, even got accepted back into AOSP.
https://android.googlesource.com/platform/external/okhttp/
Also it provides a consistent implementation on all versions of Android
where our app is installed. OkHttp supports Android 2.2 and above.

tl;dr: I have no idea what is actually fixing this issue. :disappointed_relieved: :laughing:

Feel free to test this on your own.