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