From 57e6cb4e5295c30270bbe813317f0f5d4b55dc60 Mon Sep 17 00:00:00 2001 From: Nathan Angelacos Date: Thu, 22 Nov 2007 10:51:04 +0000 Subject: 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. --- src/sliding_buffer.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/sliding_buffer.h') 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; -- cgit v1.2.3