proxy: Fix proxy chunked transfer encoding error.

There was a bug that prevented proper loading of response bodies under
these conditions:
- an http proxy server is configured
- AND the emulator makes an http request (port 80) via the proxy server
- AND the proxy server returns a body with chunked transfer encoding

Loading such a request in the Browser or Chrome would result in an
ERR_INCOMPLETE_CHUNKED_ENCODING error.

This change fixes two issues:
1) Incorrectly detecting a chunk data end error when reading the last
    '\r\n' of the chunk, due to an incorrect assumption that all prior
    data was flushed.
2) The terminating '0\r\n\r\n' chunk was not being sent.

Change-Id: I68cee8616d19993ed780213e8a38f0c3b3605a29
Signed-off-by: Weiyin He <[email protected]>
1 file changed
tree: 7f76cb4152206f4b089d3318ab37106d55801b72
  1. .vscode/
  2. accel/
  3. android/
  4. android-qemu2-glue/
  5. audio/
  6. backends/
  7. block/
  8. bsd-user/
  9. chardev/
  10. contrib/
  11. crypto/
  12. default-configs/
  13. disas/
  14. docs/
  15. fpu/
  16. fsdev/
  17. gdb-xml/
  18. hw/
  19. include/
  20. io/
  21. libdecnumber/
  22. linux-headers/
  23. linux-user/
  24. migration/
  25. nbd/
  26. net/
  27. pc-bios/
  28. po/
  29. qapi/
  30. qemu2-auto-generated/
  31. qga/
  32. qobject/
  33. qom/
  34. replay/
  35. roms/
  36. scripts/
  37. scsi/
  38. slirp/
  39. stubs/
  40. target/
  41. tcg/
  42. tests/
  43. trace/
  44. ui/
  45. util/
  46. .dir-locals.el
  47. .editorconfig
  48. .exrc
  49. .gdbinit
  50. .gitignore
  51. .gitmodules
  52. .gitpublish
  53. .mailmap
  54. .shippable.yml
  55. .travis.yml
  56. android-info.txt
  57. arch_init.c
  58. balloon.c
  59. block.c
  60. blockdev-nbd.c
  61. blockdev.c
  62. blockjob.c
  63. bootdevice.c
  64. bt-host.c
  65. bt-vhci.c
  66. build.gradle
  67. Changelog
  68. cmake-format.json
  69. cmake-main.darwin-x86_64.inc
  70. cmake-main.linux-x86_64.inc
  71. cmake-main.windows-x86.inc
  72. cmake-main.windows-x86_64.inc
  73. cmake-main.windows_msvc-x86_64.inc
  74. CMakeLists.txt
  75. CODING_STYLE
  76. configure
  77. COPYING
  78. COPYING.LIB
  79. COPYING.PYTHON
  80. cpus-common.c
  81. cpus.c
  82. device-hotplug.c
  83. device_tree.c
  84. disas.c
  85. dma-helpers.c
  86. dummy.c
  87. dump.c
  88. exec.c
  89. gdbstub.c
  90. GNUmakefile
  91. HACKING
  92. hmp-commands-info.hx
  93. hmp-commands.hx
  94. hmp.c
  95. hmp.h
  96. hvf-stub.c
  97. ioport.c
  98. iothread.c
  99. LICENSE
  100. mac.source.properties
  101. MAINTAINERS
  102. Makefile
  103. Makefile.objs
  104. Makefile.target
  105. memory.c
  106. memory_ldst.inc.c
  107. memory_mapping.c
  108. module-common.c
  109. MODULE_LICENSE_GPL
  110. monitor.c
  111. NOTICE
  112. numa.c
  113. os-posix.c
  114. os-win32.c
  115. qdev-monitor.c
  116. qdict-test-data.txt
  117. qemu-bridge-helper.c
  118. qemu-char.c
  119. qemu-doc.texi
  120. qemu-ga.texi
  121. qemu-img-cmds.hx
  122. qemu-img.c
  123. qemu-img.texi
  124. qemu-io-cmds.c
  125. qemu-io.c
  126. qemu-keymap.c
  127. qemu-nbd.c
  128. qemu-nbd.texi
  129. qemu-option-trace.texi
  130. qemu-options-wrapper.h
  131. qemu-options.def
  132. qemu-options.h
  133. qemu-options.hx
  134. qemu-seccomp.c
  135. qemu-tech.texi
  136. qemu-test.cmake
  137. qemu-version.h.in
  138. qemu.nsi
  139. qemu.sasl
  140. QEMU_VERSION
  141. qmp.c
  142. qtest.c
  143. README
  144. README.ANDROID
  145. replication.c
  146. replication.h
  147. rules.mak
  148. source.properties
  149. thunk.c
  150. tpm.c
  151. trace-events
  152. version.rc
  153. vl.c
  154. whpx-stub.c
  155. win.source.properties