aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2010-07-23 12:45:33 -0700
committerDavid 'Digit' Turner <digit@android.com>2010-07-23 12:45:33 -0700
commit1fee27e582e9ad9981dd54adad6d47f18a1aae4d (patch)
treeb21ec9a0a209bf4e0b5e7c8ef1b4176fca3c4edc
parent43552dc4fa64aad0c9fdb8f4c92ae7ac79406596 (diff)
downloadexternal_qemu-1fee27e582e9ad9981dd54adad6d47f18a1aae4d.zip
external_qemu-1fee27e582e9ad9981dd54adad6d47f18a1aae4d.tar.gz
external_qemu-1fee27e582e9ad9981dd54adad6d47f18a1aae4d.tar.bz2
fix -http-proxy implementation to work correctly with chunked encoding.
Change-Id: I3d8a18bd0849c75d0133b234a8aa74069ad71baa
-rw-r--r--CHANGES.TXT3
-rw-r--r--android/qemu-setup.c6
-rw-r--r--proxy/proxy_http_rewriter.c6
3 files changed, 15 insertions, 0 deletions
diff --git a/CHANGES.TXT b/CHANGES.TXT
index bbf1de2..fda6476 100644
--- a/CHANGES.TXT
+++ b/CHANGES.TXT
@@ -41,6 +41,9 @@ OTHER:
- Fix net shaping regression: -netspeed and -netdelay did not work anymore.
+- Fix -http-proxy implementation to properly work with chunked encodings.
+ Also accept strings like "http://:8080" as a valid proxy address.
+
==============================================================================
Changes between 6.0 and 5.0
diff --git a/android/qemu-setup.c b/android/qemu-setup.c
index 0b6b564..4f05c24 100644
--- a/android/qemu-setup.c
+++ b/android/qemu-setup.c
@@ -422,6 +422,12 @@ void android_emulation_setup( void )
proxy_name_len = p - env;
proxy_port = atoi(p+1);
+ /* handle the rare case where the proxy name is omitted, e.g. "http://:8080" */
+ if (proxy_name_len == 0) {
+ proxy_name = "localhost";
+ proxy_name_len = strlen(proxy_name);
+ }
+
D( "setting up http proxy: server=%.*s port=%d",
proxy_name_len, proxy_name, proxy_port );
diff --git a/proxy/proxy_http_rewriter.c b/proxy/proxy_http_rewriter.c
index afd929c..7645ecc 100644
--- a/proxy/proxy_http_rewriter.c
+++ b/proxy/proxy_http_rewriter.c
@@ -751,6 +751,12 @@ rewrite_connection_read_body( RewriteConnection* conn, int fd )
root->name, length);
return DATA_ERROR;
}
+ /* proxy_connection_receive_line() did remove the
+ * trailing \r\n, but we must preserve it when we
+ * send the chunk size to the proxy.
+ */
+ stralloc_add_str(root->str, "\r\n");
+
conn->chunk_length = length;
conn->chunk_total = 0;
if (length == 0) {