diff options
author | Ingela Anderton Andin <[email protected]> | 2015-10-26 09:12:35 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-10-26 09:12:35 +0100 |
commit | abb62a6d1918bc46ada942ae4f4c79caf2690d86 (patch) | |
tree | 902cf0d0840c896e8dc7df7ab26bf2e284fc39cc /erts/emulator/beam/erl_bif_port.c | |
parent | a76cc1d337c0bf44ecefebeccac2d08e496ba7e8 (diff) | |
parent | 235bf943d762bfdb5638d23b3270f92c50050b0a (diff) | |
download | otp-abb62a6d1918bc46ada942ae4f4c79caf2690d86.tar.gz otp-abb62a6d1918bc46ada942ae4f4c79caf2690d86.tar.bz2 otp-abb62a6d1918bc46ada942ae4f4c79caf2690d86.zip |
Merge branch 'ia/pr/758/OTP-12837' into maint
* ia/pr/758/OTP-12837:
erts: Include test in group so that it is run
erts: Clarify documentation
erts: Add {line_delimiter, byte()} option to inet:setopts/2
Diffstat (limited to 'erts/emulator/beam/erl_bif_port.c')
-rw-r--r-- | erts/emulator/beam/erl_bif_port.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_bif_port.c b/erts/emulator/beam/erl_bif_port.c index 3ff54c7a60..e47d7bcbbb 100644 --- a/erts/emulator/beam/erl_bif_port.c +++ b/erts/emulator/beam/erl_bif_port.c @@ -1329,7 +1329,8 @@ BIF_RETTYPE decode_packet_3(BIF_ALIST_3) ErlSubBin* rest; Eterm res; Eterm options; - int code; + int code; + char delimiter = '\n'; if (!is_binary(BIF_ARG_2) || (!is_list(BIF_ARG_3) && !is_nil(BIF_ARG_3))) { @@ -1370,6 +1371,11 @@ BIF_RETTYPE decode_packet_3(BIF_ALIST_3) case am_line_length: trunc_len = val; goto next_option; + case am_line_delimiter: + if (type == TCP_PB_LINE_LF && val >= 0 && val <= 255) { + delimiter = (char)val; + goto next_option; + } } } } @@ -1390,7 +1396,7 @@ BIF_RETTYPE decode_packet_3(BIF_ALIST_3) pca.aligned_ptr = bin_ptr; } packet_sz = packet_get_length(type, (char*)pca.aligned_ptr, pca.bin_sz, - max_plen, trunc_len, &http_state); + max_plen, trunc_len, delimiter, &http_state); if (!(packet_sz > 0 && packet_sz <= pca.bin_sz)) { if (packet_sz < 0) { goto error; |