aboutsummaryrefslogtreecommitdiffstats
path: root/proxy
diff options
context:
space:
mode:
authorDavid Turner <>2009-04-05 14:23:06 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-05 14:23:06 -0700
commit4735694ff99078f961876525ebbd55317956083f (patch)
tree0d6058c84618d7b2b30ef2b6a7d105f11dc01802 /proxy
parente8b10bc4023bf84dcdb11940bbad9baf81bdd02c (diff)
downloadexternal_qemu-4735694ff99078f961876525ebbd55317956083f.zip
external_qemu-4735694ff99078f961876525ebbd55317956083f.tar.gz
external_qemu-4735694ff99078f961876525ebbd55317956083f.tar.bz2
AI 144597: am: CL 144596 am: CL 144595 Fix the AVD configuration code to support "sdcard.path" in config.ini to indicate an explicit SD Card image file (instead of using the one in the content directory)
Note that this also fix a bug where the SD Card image was not properly locked in the previous implementation. Allow the http-proxy support code to actually manage to receive chunked encoding data, instead of complaining needlessly. Introduce a new CharBuffer object that is used indirectly by "-radio <hostdevice>" and "-gps <hostdevice>" options Add new documentation for QEMUD and CharDriverState objects Update the Audio documentation with ASCII graphics (because I'm an artist too) Original author: digit Merged from: //branches/cupcake/... Original author: android-build Automated import of CL 144597
Diffstat (limited to 'proxy')
-rw-r--r--proxy/proxy_http_rewriter.c46
1 files changed, 30 insertions, 16 deletions
diff --git a/proxy/proxy_http_rewriter.c b/proxy/proxy_http_rewriter.c
index 812bf9c..cb7c94b 100644
--- a/proxy/proxy_http_rewriter.c
+++ b/proxy/proxy_http_rewriter.c
@@ -62,6 +62,9 @@
**
**/
+/* HttpHeader is a simple structure used to hold a (key,value)
+ * pair in a linked list.
+ */
typedef struct HttpHeader {
struct HttpHeader* next;
const char* key;
@@ -104,6 +107,12 @@ http_header_alloc( const char* key, const char* value )
return h;
}
+/** *************************************************************
+ **
+ ** HTTP HEADERS LIST
+ **
+ **/
+
typedef struct {
HttpHeader* first;
HttpHeader* last;
@@ -166,15 +175,18 @@ typedef enum {
HTTP_REQUEST_DELETE,
} HttpRequestType;
+/* HttpRequest is used both to store information about a specific
+ * request and the corresponding reply
+ */
typedef struct {
- HttpRequestType req_type;
- char* req_method;
- char* req_uri;
- char* req_version;
- char* rep_version;
- int rep_code;
- char* rep_readable;
- HttpHeaderList headers[1];
+ HttpRequestType req_type; /* request type */
+ char* req_method; /* "GET", "POST", "HEAD", etc... */
+ char* req_uri; /* the request URI */
+ char* req_version; /* "HTTP/1.0" or "HTTP/1.1" */
+ char* rep_version; /* reply version string */
+ int rep_code; /* reply code as decimal */
+ char* rep_readable; /* human-friendly reply/error message */
+ HttpHeaderList headers[1]; /* headers */
} HttpRequest;
@@ -641,6 +653,16 @@ rewrite_connection_get_body_length( RewriteConnection* conn,
conn->body_length = body_len;
}
} else {
+ transfer_encoding = http_request_find_header(r, "Transfer-Encoding");
+ if (transfer_encoding && !strcasecmp(transfer_encoding, "Chunked")) {
+ conn->body_mode = BODY_CHUNKED;
+ conn->parse_chunk_header = 0;
+ conn->parse_chunk_trailer = 0;
+ conn->chunk_length = -1;
+ conn->chunk_total = 0;
+ }
+ }
+ if (conn->body_mode == BODY_NONE) {
char* connection = http_request_find_header(r, "Proxy-Connection");
if (!connection)
@@ -658,14 +680,6 @@ rewrite_connection_get_body_length( RewriteConnection* conn,
*/
conn->body_mode = BODY_UNTIL_CLOSE;
}
- transfer_encoding = http_request_find_header(r, "Transfer-Encoding");
- if (transfer_encoding && !strcasecmp(transfer_encoding, "Chunked")) {
- conn->body_mode = BODY_CHUNKED;
- conn->parse_chunk_header = 0;
- conn->parse_chunk_trailer = 0;
- conn->chunk_length = -1;
- conn->chunk_total = 0;
- }
D("%s: body_length=%lld body_mode=%s",
root->name, conn->body_length,
body_mode_str[conn->body_mode]);