0

I'm implementing a small web server into a wifi micro. To aid in development and test, I have ported it to Windows console program.

I use chunked transfer processing. The following is what shows up on the browser:

0059

Hello World

0

The 59 is the hex size of the chunk and the 0 is the chunked terminating size

This is the data captured via wireshark:

This is the first message I send which are the headers

0000   48 54 54 50 2f 31 2e 31 20 32 30 30 20 4f 4b 0d  HTTP/1.1 200 OK.
0010   0a 53 65 72 76 65 72 3a 20 54 72 61 6e 73 66 65  .Server: Transfe
0020   72 2d 45 6e 63 6f 64 69 6e 67 3a 20 63 68 75 6e  r-Encoding: chun
0030   6b 65 64 0d 0a 43 6f 6e 74 65 6e 74 2d 54 79 70  ked..Content-Typ
0040   65 3a 20 74 65 78 74 2f 68 74 6d 6c 0d 0a 43 61  e: text/html..Ca
0050   63 68 65 2d 43 6f 6e 74 72 6f 6c 3a 20 6d 61 78  che-Control: max
0060   2d 61 67 65 3d 33 36 30 30 2c 20 6d 75 73 74 2d  -age=3600, must-
0070   72 65 76 61 6c 69 64 61 74 65 0d 0a 0d 0a        revalidate....

The next block is the chunked data

0000   30 30 35 39 0d 0a 3c 68 74 6d 6c 3e 0a 3c 68 65  0059..<html>.<he
0010   61 64 3e 3c 74 69 74 6c 65 3e 57 65 62 20 53 65  ad><title>Web Se
0020   72 76 65 72 3c 2f 74 69 74 6c 65 3e 0a 3c 2f 68  rver</title>.</h
0030   65 61 64 3e 0a 3c 62 6f 64 79 3e 0a 3c 68 31 3e  ead>.<body>.<h1>
0040   48 65 6c 6c 6f 20 57 6f 72 6c 64 3c 2f 68 31 3e  Hello World</h1>
0050   0a 3c 2f 62 6f 64 79 3e 3c 2f 68 74 6d 6c 3e 0d  .</body></html>.
0060   0a 30 0d 0a 0d 0a                                .0....

The chunked values are being displayed on both Chrome and IE.

Can anyone see an issue with my data that would cause the issue.

Thanks

JHinkle
  • 186
  • 2
  • 10

1 Answers1

0

Solved:

I mistakenly remove the server name so now the browser is taking the transfer encoding as the server name and does not understand the chunked message size -- it thinks its just data to display.

JHinkle
  • 186
  • 2
  • 10