summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2007-01-12 19:09:14 +0100
committerMichael Brown2007-01-12 19:09:14 +0100
commit83b7933f8a80e688579218450c4dbacc55c61309 (patch)
tree6f5dc0ee8c6e96d81d4641253a540617634c75d1 /src/include
parentNo need to maintain a received byte count; we always fill in sequential (diff)
downloadipxe-83b7933f8a80e688579218450c4dbacc55c61309.tar.gz
ipxe-83b7933f8a80e688579218450c4dbacc55c61309.tar.xz
ipxe-83b7933f8a80e688579218450c4dbacc55c61309.zip
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.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gpxe/linebuf.h23
1 files changed, 7 insertions, 16 deletions
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 */