summaryrefslogtreecommitdiffstats
path: root/src/sliding_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sliding_buffer.c')
-rw-r--r--src/sliding_buffer.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/sliding_buffer.c b/src/sliding_buffer.c
index 177d0d8..9883b78 100644
--- a/src/sliding_buffer.c
+++ b/src/sliding_buffer.c
@@ -43,8 +43,6 @@ s_buffer_init (sliding_buffer_t * sbuf, int size)
sbuf->len = 0;
sbuf->ptr = sbuf->buf;
sbuf->bufsize = 0;
- sbuf->extent = 0;
- sbuf->extent_used = 0;
return (sbuf->buf != NULL); /* return true if the alloc succeeded */
}
@@ -100,17 +98,7 @@ s_buffer_read (sliding_buffer_t * sbuf, char *matchstr)
}
else
{
-
- /* if we have an extent, read the smaller of remaining
- * extent or bufsize
- */
- max = sbuf->maxsize - len;
- if ((sbuf->extent > 0) && (sbuf->maxsize - len) < max)
- {
- max = sbuf->extent - sbuf->extent_used;
- }
- r = read (sbuf->fh, sbuf->buf + len, max);
- sbuf->extent_used += r;
+ r = read (sbuf->fh, sbuf->buf + len, sbuf->maxsize - len);
}
/*
* only report eof when we've done a read of 0.