diff --git a/netutils/thttpd/config.h b/netutils/thttpd/config.h index 5eade0d47e6..b63320c7d9f 100644 --- a/netutils/thttpd/config.h +++ b/netutils/thttpd/config.h @@ -144,8 +144,12 @@ # define CONFIG_THTTPD_IOBUFFERSIZE 256 # endif +# ifndef CONFIG_THTTPD_MINSTRSIZE +# define CONFIG_THTTPD_MINSTRSIZE 64 +# endif + # ifndef CONFIG_THTTPD_REALLOCINCR -# define CONFIG_THTTPD_REALLOCINCR 128 +# define CONFIG_THTTPD_REALLOCINCR 64 # endif # ifndef CONFIG_THTTPD_MAXREALLOC @@ -153,7 +157,7 @@ # endif # if CONFIG_THTTPD_IOBUFFERSIZE > 65535 -# error "Can't use uint16 for buffer" +# error "Can't use uint16 for buffer size" # endif /* A list of index filenames to check. The files are searched for in this order. */ diff --git a/netutils/thttpd/httpd_alloc.c b/netutils/thttpd/httpd_alloc.c index 009dc6541e9..6f132f16620 100755 --- a/netutils/thttpd/httpd_alloc.c +++ b/netutils/thttpd/httpd_alloc.c @@ -139,7 +139,7 @@ void httpd_realloc_str(char **pstr, size_t *maxsize, size_t size) size_t oldsize; if (*maxsize == 0) { - *maxsize = MAX(CONFIG_THTTPD_IOBUFFERSIZE, size + CONFIG_THTTPD_REALLOCINCR); + *maxsize = MAX(CONFIG_THTTPD_MINSTRSIZE, size + CONFIG_THTTPD_REALLOCINCR); *pstr = NEW(char, *maxsize + 1); } else if (size > *maxsize)