mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 05:21:49 +03:00
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.
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user