aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/packet_parser.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2010-06-10 15:56:12 +0200
committerSverker Eriksson <[email protected]>2010-06-10 15:56:12 +0200
commit288f54c8f4f7cac0951f0807e4a6d3b59c099156 (patch)
treeb28c22ade745851c9eb6211b82ed06c3d37c2258 /erts/emulator/beam/packet_parser.c
parent627f79fc893a779f009b47cd8e9819eb7f34a7a0 (diff)
downloadotp-288f54c8f4f7cac0951f0807e4a6d3b59c099156.tar.gz
otp-288f54c8f4f7cac0951f0807e4a6d3b59c099156.tar.bz2
otp-288f54c8f4f7cac0951f0807e4a6d3b59c099156.zip
{packet,http} allow empty response phrase
Packet type 'http' for erlang:deocode:packet and gen_tcp allow a response line with an empty phrase string, like "HTTP/1.1 200\r\n". Earlier, an empty phrase was only accepted if the status code was followed by space or tab, like "HTTP/1.1 200 \r\n".
Diffstat (limited to 'erts/emulator/beam/packet_parser.c')
-rw-r--r--erts/emulator/beam/packet_parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/packet_parser.c b/erts/emulator/beam/packet_parser.c
index 8c8029d450..5bcd567b5f 100644
--- a/erts/emulator/beam/packet_parser.c
+++ b/erts/emulator/beam/packet_parser.c
@@ -679,7 +679,7 @@ int packet_parse_http(const char* buf, int len, int* statep,
while (n && SP(ptr)) {
ptr++; n--;
}
- if (ptr==p0) return -1;
+ if (ptr==p0 && n>0) return -1;
/* NOTE: the syntax allows empty reason phrases */
(*statep) = !0;