aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/packet_parser.c
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2015-10-27 09:46:09 +0100
committerIngela Anderton Andin <[email protected]>2015-10-27 09:46:09 +0100
commit7908256c72e4a110154c2db61220973fff511614 (patch)
tree4a907c3580e1b037cfc80f0ed87472366ddbf729 /erts/emulator/beam/packet_parser.c
parenta76cc1d337c0bf44ecefebeccac2d08e496ba7e8 (diff)
parent61d214cff5fe50b2806f8f977d36bccd412bcfc4 (diff)
downloadotp-7908256c72e4a110154c2db61220973fff511614.tar.gz
otp-7908256c72e4a110154c2db61220973fff511614.tar.bz2
otp-7908256c72e4a110154c2db61220973fff511614.zip
Merge branch 'preloaded/ia/pr/758/OTP-12837' into maint
* preloaded/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/packet_parser.c')
-rw-r--r--erts/emulator/beam/packet_parser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/erts/emulator/beam/packet_parser.c b/erts/emulator/beam/packet_parser.c
index 2dd421a9e9..a737a86f14 100644
--- a/erts/emulator/beam/packet_parser.c
+++ b/erts/emulator/beam/packet_parser.c
@@ -256,6 +256,7 @@ int packet_get_length(enum PacketParseType htype,
const char* ptr, unsigned n, /* Bytes read so far */
unsigned max_plen, /* Max packet length, 0=no limit */
unsigned trunc_len, /* Truncate (lines) if longer, 0=no limit */
+ char delimiter, /* Line delimiting character */
int* statep) /* Protocol specific state */
{
unsigned hlen, plen;
@@ -299,9 +300,9 @@ int packet_get_length(enum PacketParseType htype,
goto remain;
case TCP_PB_LINE_LF: {
- /* TCP_PB_LINE_LF: [Data ... \n] */
+ /* TCP_PB_LINE_LF: [Data ... Delimiter] */
const char* ptr2;
- if ((ptr2 = memchr(ptr, '\n', n)) == NULL) {
+ if ((ptr2 = memchr(ptr, delimiter, n)) == NULL) {
if (n > max_plen && max_plen != 0) { /* packet full */
DEBUGF((" => packet full (no NL)=%d\r\n", n));
goto error;