mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
New EVBUFFER_EOL_NUL to read NUL-terminated strings from an evbuffer
This commit is contained in:
parent
27b5398fe0
commit
d7a8b36eaf
5
buffer.c
5
buffer.c
@ -1498,6 +1498,11 @@ evbuffer_search_eol(struct evbuffer *buffer,
|
||||
goto done;
|
||||
extra_drain = 1;
|
||||
break;
|
||||
case EVBUFFER_EOL_NUL:
|
||||
if (evbuffer_strchr(&it, '\0') < 0)
|
||||
goto done;
|
||||
extra_drain = 1;
|
||||
break;
|
||||
default:
|
||||
goto done;
|
||||
}
|
||||
|
@ -387,7 +387,9 @@ enum evbuffer_eol_style {
|
||||
/** An EOL is a CR followed by an LF. */
|
||||
EVBUFFER_EOL_CRLF_STRICT,
|
||||
/** An EOL is a LF. */
|
||||
EVBUFFER_EOL_LF
|
||||
EVBUFFER_EOL_LF,
|
||||
/** An EOL is a NUL character (that is, a single byte with value 0) */
|
||||
EVBUFFER_EOL_NUL
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user