From: David Turner <> Date: Sun, 5 Apr 2009 21:22:25 +0000 (-0700) Subject: AI 144596: am: CL 144595 Fix the AVD configuration code to support "sdcard.path"... X-Git-Tag: android-x86-2.2~610^2~478 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c431da5427ce7d8712451dd7f0a70ac165b201cf;p=android-x86%2Fsdk.git AI 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 " and "-gps " 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/... Automated import of CL 144596 --- diff --git a/emulator/qemud/qemud.c b/emulator/qemud/qemud.c index bd49e5253..8f7e616b5 100644 --- a/emulator/qemud/qemud.c +++ b/emulator/qemud/qemud.c @@ -42,15 +42,15 @@ * internal unique channel number > 0, then sends a connection * initiation request to the emulator (i.e. through channel 0): * - * connect:: + * connect:: * - * where is the service name, and is a 4-hexchar + * where is the service name, and is a 2-hexchar * number corresponding to the channel number. * * * in case of success, the emulator responds through channel 0 * with: * - * ok:connect: + * ok:connect: * * after this, all messages between the client and the emulator * are passed in pass-through mode. @@ -58,12 +58,12 @@ * * if the emulator refuses the service connection, it will * send the following through channel 0: * - * ko:connect::reason-for-failure + * ko:connect::reason-for-failure * * * If the client closes the connection, qemud sends the following * to the emulator: * - * disconnect: + * disconnect: * * The same message is the opposite direction if the emulator * chooses to close the connection. @@ -1429,8 +1429,8 @@ static void multiplexer_handle_control( Multiplexer* mult, Packet* p ) { /* connection registration success */ - if (p->len == 15 && !memcmp(p->data, "ok:connect:", 11)) { - int channel = hex2int(p->data+11, 4); + if (p->len == 13 && !memcmp(p->data, "ok:connect:", 11)) { + int channel = hex2int(p->data+11, 2); Client* client = multiplexer_find_client(mult, channel); /* note that 'client' can be NULL if the corresponding @@ -1443,8 +1443,8 @@ multiplexer_handle_control( Multiplexer* mult, Packet* p ) } /* connection registration failure */ - if (p->len >= 15 && !memcmp(p->data, "ko:connect:",11)) { - int channel = hex2int(p->data+11, 4); + if (p->len >= 13 && !memcmp(p->data, "ko:connect:",11)) { + int channel = hex2int(p->data+11, 2); Client* client = multiplexer_find_client(mult, channel); if (client != NULL) @@ -1454,8 +1454,8 @@ multiplexer_handle_control( Multiplexer* mult, Packet* p ) } /* emulator-induced client disconnection */ - if (p->len == 15 && !memcmp(p->data, "disconnect:",11)) { - int channel = hex2int(p->data+11, 4); + if (p->len == 13 && !memcmp(p->data, "disconnect:",11)) { + int channel = hex2int(p->data+11, 2); Client* client = multiplexer_find_client(mult, channel); if (client != NULL) @@ -1536,7 +1536,7 @@ multiplexer_open_channel( Multiplexer* mult, Packet* service ) goto TRY_AGAIN; } - len = snprintf((char*)p->data, sizeof p->data, "connect:%.*s:%04x", service->len, service->data, channel); + len = snprintf((char*)p->data, sizeof p->data, "connect:%.*s:%02x", service->len, service->data, channel); if (len >= (int)sizeof(p->data)) { D("%s: weird, service name too long (%d > %d)", __FUNCTION__, len, sizeof(p->data)); packet_free(&p); @@ -1554,7 +1554,7 @@ static void multiplexer_close_channel( Multiplexer* mult, int channel ) { Packet* p = packet_alloc(); - int len = snprintf((char*)p->data, sizeof(p->data), "disconnect:%04x", channel); + int len = snprintf((char*)p->data, sizeof(p->data), "disconnect:%02x", channel); if (len > (int)sizeof(p->data)) { /* should not happen */