summaryrefslogtreecommitdiffstats
path: root/src/sliding_buffer.h
diff options
context:
space:
mode:
authorNathan Angelacos <nangel@alpinelinux.org>2007-11-22 10:51:04 +0000
committerNathan Angelacos <nangel@alpinelinux.org>2007-11-22 10:51:04 +0000
commit57e6cb4e5295c30270bbe813317f0f5d4b55dc60 (patch)
tree7e8d15e6fab731cec7988aab561d605b111d4935 /src/sliding_buffer.h
parent7255680e130274fbb31b61a0ebc916767a773eab (diff)
downloadhaserl-57e6cb4e5295c30270bbe813317f0f5d4b55dc60.tar.bz2
haserl-57e6cb4e5295c30270bbe813317f0f5d4b55dc60.tar.xz
Optimize changing plusses to spaces in CGIPOST (was checking the strlen each iteration)
Sliding_buffer now reads up to extent size bytes and quits, if extent is given. This is to read CONTENT_LENGTH bytes and no more.
Diffstat (limited to 'src/sliding_buffer.h')
-rw-r--r--src/sliding_buffer.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sliding_buffer.h b/src/sliding_buffer.h
index 838e386..148b369 100644
--- a/src/sliding_buffer.h
+++ b/src/sliding_buffer.h
@@ -8,10 +8,12 @@ typedef struct {
unsigned char *buf; /* pointer to the buffer */
unsigned char *ptr; /* start positon (used internally) */
unsigned char *segment; /* the start position of this segment */
- int len; /* length of this segment */
- int maxsize; /* max size of buffer */
- int bufsize; /* current size of buffer */
+ size_t len; /* length of this segment */
+ size_t maxsize; /* max size of buffer */
+ size_t bufsize; /* current size of buffer */
int eof; /* true if there is no more to read */
+ size_t extent; /* if non-zero, max number of bytes to read */
+ size_t extent_used; /* how much we have already read */
} sliding_buffer_t;