Thanks a lot, I could find a bug in the http rewriter source code. It is
triggered by the Keep-Alive + chunked reply.
I'll file a bug for it and start working on it.

However, I'd like to be able to test it. Anyone knows a proxy that can be
setup to answer this way ?

On Tue, Mar 24, 2009 at 4:22 PM, m5p3nc3r <[email protected]> wrote:

>
> Sorry for the large blob, but here goes:
>
> http_service_connect: trying to connect to 209.85.229.147 on port 80
> http_service_connect: using HTTP rewriter
> tcp:209.85.229.147:80(16): connecting
> tcp:209.85.229.147:80(16): connected to proxy
> tcp:209.85.229.147:80(16): socket pair created
> tcp:209.85.229.147:80(16): received 'GET / HTTP/1.1'
> tcp:209.85.229.147:80(16): request first line ok
> tcp:209.85.229.147:80(16): received 'Host: www.google.co.uk'
> tcp:209.85.229.147:80(16): received 'Accept-Encoding: gzip'
> tcp:209.85.229.147:80(16): received 'Accept: text/xml,application/
> xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/
> *;q=0.5'
> tcp:209.85.229.147:80(16): received 'User-Agent: Mozilla/5.0 (Linux;
> U; Android 1.1; en-us; generic) AppleWebKit/525.10+ (KHTML, like
> Gecko) Version/3.0.4 Mobile Safari/523.12.2'
> tcp:209.85.229.147:80(16): received 'cookie:
> PREF=ID=9b27b0c4bb3ccab7:TM=1237904551:LM=1237904551:S=cv8iLxR5b3eOgTYD;
> MPRF=H4sIAAAAAAAAAKvY-
> eDjsWaVLiaGSUwKKcZmxpYmyUnmFpYGxsYpyamWxmbmxgaWxgaphmkpZpYAq0QklS0AAAA'
> tcp:209.85.229.147:80(16): received 'Accept-Language: en-US'
> tcp:209.85.229.147:80(16): received 'Accept-Charset: utf-8,
> iso-8859-1, utf-16, *;q=0.7'
> tcp:209.85.229.147:80(16): received ''
> tcp:209.85.229.147:80(16): request headers ok
> tcp:209.85.229.147:80(16): sending 643 bytes:
> >> 47 45 54 20 68 74 74 70 3a 2f 2f 77 77 77 2e 67    GET http://www.g
> >> 6f 6f 67 6c 65 2e 63 6f 2e 75 6b 2f 20 48 54 54    oogle.co.uk/ HTT
> >> 50 2f 31 2e 31 0d 0a 48 6f 73 74 3a 20 77 77 77    P/1.1..Host: www
> >> 2e 67 6f 6f 67 6c 65 2e 63 6f 2e 75 6b 0d 0a 41    .google.co.uk..A
> >> 63 63 65 70 74 2d 45 6e 63 6f 64 69 6e 67 3a 20    ccept-Encoding:
> >> 67 7a 69 70 0d 0a 41 63 63 65 70 74 3a 20 74 65    gzip..Accept: te
> >> 78 74 2f 78 6d 6c 2c 61 70 70 6c 69 63 61 74 69    xt/xml,applicati
> >> 6f 6e 2f 78 6d 6c 2c 61 70 70 6c 69 63 61 74 69    on/xml,applicati
> >> 6f 6e 2f 78 68 74 6d 6c 2b 78 6d 6c 2c 74 65 78    on/xhtml+xml,tex
> >> 74 2f 68 74 6d 6c 3b 71 3d 30 2e 39 2c 74 65 78    t/html;q=0.9,tex
> >> 74 2f 70 6c 61 69 6e 3b 71 3d 30 2e 38 2c 69 6d    t/plain;q=0.8,im
> >> 61 67 65 2f 70 6e 67 2c 2a 2f 2a 3b 71 3d 30 2e    age/png,*/*;q=0.
> >> 35 0d 0a 55 73 65 72 2d 41 67 65 6e 74 3a 20 4d    5..User-Agent: M
> >> 6f 7a 69 6c 6c 61 2f 35 2e 30 20 28 4c 69 6e 75    ozilla/5.0 (Linu
> >> 78 3b 20 55 3b 20 41 6e 64 72 6f 69 64 20 31 2e    x; U; Android 1.
> >> 31 3b 20 65 6e 2d 75 73 3b 20 67 65 6e 65 72 69    1; en-us; generi
> >> 63 29 20 41 70 70 6c 65 57 65 62 4b 69 74 2f 35    c) AppleWebKit/5
> >> 32 35 2e 31 30 2b 20 28 4b 48 54 4d 4c 2c 20 6c    25.10+ (KHTML, l
> >> 69 6b 65 20 47 65 63 6b 6f 29 20 56 65 72 73 69    ike Gecko) Versi
> >> 6f 6e 2f 33 2e 30 2e 34 20 4d 6f 62 69 6c 65 20    on/3.0.4 Mobile
> >> 53 61 66 61 72 69 2f 35 32 33 2e 31 32 2e 32 0d    Safari/523.12.2.
> >> 0a 63 6f 6f 6b 69 65 3a 20 50 52 45 46 3d 49 44    .cookie: PREF=ID
> >> 3d 39 62 32 37 62 30 63 34 62 62 33 63 63 61 62    =9b27b0c4bb3ccab
> >> 37 3a 54 4d 3d 31 32 33 37 39 30 34 35 35 31 3a    7:TM=1237904551:
> >> 4c 4d 3d 31 32 33 37 39 30 34 35 35 31 3a 53 3d    LM=1237904551:S=
> >> 63 76 38 69 4c 78 52 35 62 33 65 4f 67 54 59 44    cv8iLxR5b3eOgTYD
> >> 3b 20 4d 50 52 46 3d 48 34 73 49 41 41 41 41 41    ; MPRF=H4sIAAAAA
> >> 41 41 41 41 4b 76 59 2d 65 44 6a 73 57 61 56 4c    AAAAKvY-eDjsWaVL
> >> 69 61 47 53 55 77 4b 4b 63 5a 6d 78 70 59 6d 79    iaGSUwKKcZmxpYmy
> >> 55 6e 6d 46 70 59 47 78 73 59 70 79 61 6d 57 78    UnmFpYGxsYpyamWx
> >> 6d 62 6d 78 67 61 57 78 67 61 70 68 6d 6b 70 5a    mbmxgaWxgaphmkpZ
> >> 70 59 41 71 30 51 6b 6c 53 30 41 41 41 41 0d 0a    pYAq0QklS0AAAA..
>
> tcp:209.85.229.147:80(16): request sent, waiting for reply
> tcp:209.85.229.147:80(16): received 'HTTP/1.1 200 OK'
> tcp:209.85.229.147:80(16): reply first line ok
> tcp:209.85.229.147:80(16): received 'Via: 1.1 UKPROXY06'
> tcp:209.85.229.147:80(16): received 'Connection: Keep-Alive'
> tcp:209.85.229.147:80(16): received 'Proxy-Connection: Keep-Alive'
> tcp:209.85.229.147:80(16): received 'Transfer-Encoding: chunked'
> tcp:209.85.229.147:80(16): received 'Expires: Tue, 24 Mar 2009
> 14:27:32 GMT'
> tcp:209.85.229.147:80(16): received 'Date: Tue, 24 Mar 2009 14:27:32
> GMT'
> tcp:209.85.229.147:80(16): received 'Content-Type: text/html;
> charset=UTF-8'
> tcp:209.85.229.147:80(16): received 'Server: GFE/1.3'
> tcp:209.85.229.147:80(16): received 'Set-Cookie:
>
> MPRF=H4sIAAAAAAAAAKvo62453qzSxcQwiUkhxdjM2NIkOcncwtLA2DglOdXS2Mzc2MDS2CDVMC3FzBIA_9vpxi0AAAA;
> expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.co.uk'
> tcp:209.85.229.147:80(16): received 'Cache-Control: private, max-
> age=1209600'
> tcp:209.85.229.147:80(16): received 'X-Content-Type-Options: nosniff'
> tcp:209.85.229.147:80(16): received ''
> tcp:209.85.229.147:80(16): reply headers ok
> tcp:209.85.229.147:80(16): sending 504 bytes:
> >> 48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d    HTTP/1.1 200 OK.
> >> 0a 56 69 61 3a 20 31 2e 31 20 55 4b 50 52 4f 58    .Via: 1.1 UKPROX
> >> 59 30 36 0d 0a 43 6f 6e 6e 65 63 74 69 6f 6e 3a    Y06..Connection:
> >> 20 4b 65 65 70 2d 41 6c 69 76 65 0d 0a 50 72 6f     Keep-Alive..Pro
> >> 78 79 2d 43 6f 6e 6e 65 63 74 69 6f 6e 3a 20 4b    xy-Connection: K
> >> 65 65 70 2d 41 6c 69 76 65 0d 0a 54 72 61 6e 73    eep-Alive..Trans
> >> 66 65 72 2d 45 6e 63 6f 64 69 6e 67 3a 20 63 68    fer-Encoding: ch
> >> 75 6e 6b 65 64 0d 0a 45 78 70 69 72 65 73 3a 20    unked..Expires:
> >> 54 75 65 2c 20 32 34 20 4d 61 72 20 32 30 30 39    Tue, 24 Mar 2009
> >> 20 31 34 3a 32 37 3a 33 32 20 47 4d 54 0d 0a 44     14:27:32 GMT..D
> >> 61 74 65 3a 20 54 75 65 2c 20 32 34 20 4d 61 72    ate: Tue, 24 Mar
> >> 20 32 30 30 39 20 31 34 3a 32 37 3a 33 32 20 47     2009 14:27:32 G
> >> 4d 54 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70 65    MT..Content-Type
> >> 3a 20 74 65 78 74 2f 68 74 6d 6c 3b 20 63 68 61    : text/html; cha
> >> 72 73 65 74 3d 55 54 46 2d 38 0d 0a 53 65 72 76    rset=UTF-8..Serv
> >> 65 72 3a 20 47 46 45 2f 31 2e 33 0d 0a 53 65 74    er: GFE/1.3..Set
> >> 2d 43 6f 6f 6b 69 65 3a 20 4d 50 52 46 3d 48 34    -Cookie: MPRF=H4
> >> 73 49 41 41 41 41 41 41 41 41 41 4b 76 6f 36 32    sIAAAAAAAAAKvo62
> >> 34 35 33 71 7a 53 78 63 51 77 69 55 6b 68 78 64    453qzSxcQwiUkhxd
> >> 6a 4d 32 4e 49 6b 4f 63 6e 63 77 74 4c 41 32 44    jM2NIkOcncwtLA2D
> >> 67 6c 4f 64 58 53 32 4d 7a 63 32 4d 44 53 32 43    glOdXS2Mzc2MDS2C
> >> 44 56 4d 43 33 46 7a 42 49 41 5f 39 76 70 78 69    DVMC3FzBIA_9vpxi
> >> 30 41 41 41 41 3b 20 65 78 70 69 72 65 73 3d 53    0AAAA; expires=S
> >> 75 6e 2c 20 31 37 2d 4a 61 6e 2d 32 30 33 38 20    un, 17-Jan-2038
> >> 31 39 3a 31 34 3a 30 37 20 47 4d 54 3b 20 70 61    19:14:07 GMT; pa
> >> 74 68 3d 2f 3b 20 64 6f 6d 61 69 6e 3d 2e 67 6f    th=/; domain=.go
> >> 6f 67 6c 65 2e 63 6f 2e 75 6b 0d 0a 43 61 63 68    ogle.co.uk..Cach
> >> 65 2d 43 6f 6e 74 72 6f 6c 3a 20 70 72 69 76 61    e-Control: priva
> >> 74 65 2c 20 6d 61 78 2d 61 67 65 3d 31 32 30 39    te, max-age=1209
> >> 36 30 30 0d 0a 58 2d 43 6f 6e 74 65 6e 74 2d 54    600..X-Content-T
> >> 79 70 65 2d 4f 70 74 69 6f 6e 73 3a 20 6e 6f 73    ype-Options: nos
> >> 6e 69 66 66 0d 0a 0d 0a                            niff....
>
> tcp:209.85.229.147:80(16): can't determine content length, and client
> wants to keep connection opened
>
>
> On Mar 24, 3:00 pm, David Turner <[email protected]> wrote:
> > That very well could be a bug in the chunk encoding support of the http
> > rewriter within the emulator's proxy code.
> > I could not test it against a lot of cases.
> >
> > Can you dump the output of "emulator -debug-proxy" when you try to
> connect
> > towww.google.comthrough your proxy ?
> > This will print out the exact messages exchanged.
> >
> > On Tue, Mar 24, 2009 at 3:39 PM, m5p3nc3r <[email protected]>
> wrote:
> >
> > > Hi All
> >
> > > I am having a specific problem that is preventing me using the android
> > > SDK from work.  We are using a MS Proxy here that all internet traffic
> > > has to go through.  The problem seems to be when the emulator is
> > > trying to access a site that uses 'Transfer-Encoding: chunked'
> >
> > > If I attempt to downloadwww.nds.com(no chunked encoding) into the
> > > browser, it works fine.
> >
> > > However if I try to go towww.google.com(uses chunked encoding), the
> > > browser fails with the message:
> > >  can't determine content length, and client wants to keep connection
> > > opened
> >
> > > My feeling (and I'm no expert in this area) is that the underlying
> > > code managing the communication through the proxy is not dealing with
> > > the null terminator on the chunk encoded response when the connection
> > > to the proxy is being kept open?
> >
> > > Does anyone have any experience in this area?  Is the source to the
> > > emulator available so I can try and understand what is going on here?
> >
> > > Cheers
> >
> > > Matt
> >
> >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to