Karta. SMTP. LineBuffer
(Karta v1.0.0)
Frames SMTP command lines. Holds at most max bytes of an unfinished line
plus one network read, so a client can never make us buffer without limit.
Lines must end in CRLF; a bare LF, or a CR anywhere else in the line, is
returned as {:bare_newline, line} so the session can reject it (a defence
against SMTP smuggling).
Summary
Functions
Pops the next complete line. max counts the line including its line ending.
Returns all unconsumed bytes and empties the buffer.
Types
@type t() :: %Karta.SMTP.LineBuffer{data: binary(), max: pos_integer()}
Functions
@spec new(pos_integer()) :: t()
Pops the next complete line. max counts the line including its line ending.
Returns all unconsumed bytes and empties the buffer.