From 83b7933f8a80e688579218450c4dbacc55c61309 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 12 Jan 2007 18:09:14 +0000 Subject: Damn it; my lovely resilient scheme falls down when you have a protocol that switches from line-oriented to byte-oriented partway through, such as HTTP. --- src/include/gpxe/linebuf.h | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'src/include') diff --git a/src/include/gpxe/linebuf.h b/src/include/gpxe/linebuf.h index 72b477526..f4481ddfe 100644 --- a/src/include/gpxe/linebuf.h +++ b/src/include/gpxe/linebuf.h @@ -12,26 +12,17 @@ /** A line buffer */ struct line_buffer { - /** Current data in the buffer */ + /** Current string in the buffer */ char *data; - /** Length of current data */ + /** Length of current string, excluding the terminating NUL */ size_t len; - /** Bitmask of terminating characters to skip over */ - unsigned int skip_terminators; + /** String is ready to read */ + int ready; }; -/** - * Retrieve buffered-up line - * - * @v linebuf Line buffer - * @ret line Buffered line, or NULL if no line present - */ -static inline char * buffered_line ( struct line_buffer *linebuf ) { - return linebuf->data; -} - -extern int line_buffer ( struct line_buffer *linebuf, const char *data, - size_t len ); +extern char * buffered_line ( struct line_buffer *linebuf ); +extern int line_buffer ( struct line_buffer *linebuf, + const char **data, size_t *len ); extern void empty_line_buffer ( struct line_buffer *linebuf ); #endif /* _GPXE_LINEBUF_H */ -- cgit v1.2.3-55-g7522