12#ifndef OPENVPN_BUFFER_BUFLIMIT_H
13#define OPENVPN_BUFFER_BUFLIMIT_H
30 const T max_bytes_arg)
32 set_max(max_lines_arg, max_bytes_arg);
39 const T max_bytes_arg)
52 T size = (T)buf.
size();
58 const unsigned char *p = buf.
c_data();
61 const unsigned char c = *p++;
virtual void bytes_exceeded()=0
void add(const Buffer &buf)
virtual ~BufferLimit()=default
void set_max(const T max_lines_arg, const T max_bytes_arg)
BufferLimit(const T max_lines_arg, const T max_bytes_arg)
virtual void lines_exceeded()=0
const T * c_data() const
Returns a const pointer to the start of the buffer.
size_t size() const
Returns the size of the buffer in T objects.