Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Correct guard on wait_for syslog buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
archaelus committed Dec 14, 2011
1 parent 7580d10 commit d39eac1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/syslog_parser.erl
Expand Up @@ -44,7 +44,8 @@ push(Bytes, Buf = #buf{bytes=OldBuf, waiting_for=WF})
push(iolist_to_binary([OldBuf, Bytes]), WF, Buf).

push(Bytes, RequiredLength, Buf)
when byte_size(Bytes) < RequiredLength ->
when is_integer(RequiredLength),
byte_size(Bytes) < RequiredLength ->
%% Haven't accumulated enough bytes to complete a parse yet.
{ok, [], Buf#buf{bytes=Bytes}};
push(Bytes, _, _) ->
Expand Down

0 comments on commit d39eac1

Please sign in to comment.