Hi Joel! Nice to hear that RTEMS is using SHTTPD. On 10/08/07, Joel Sherrill <[EMAIL PROTECTED]> wrote: > Issue #1: In building for the avr and h8300, there > were errors. When I investigated, I came across > this in shttpd: > > defs.h:#define URI_MAX 32768 /* Maximum URI > size */ > log.c: char date[64], buf[URI_MAX]; > log.c: char date[64], buf[URI_MAX], *q1 = "\"", *q2 = "\""; > shttpd.c: char path[URI_MAX], buf[1024]; > > These put 32K on the stack. This is extremely excessive > for most embedded applications (4-8K fixed stacks are > typical) and over the memory limits for stacks on the > CPUs that flagged this. Is there anything > that can be done about these?
The reason such big buffer is allocated is that the log message contains the URI, but I think it can be done the other way. We can fprintf() directly to the file stream without using big intermediate buffer. Small intermediate buffer might be used for printing date, etc. > Issue #2: GCC dies with an internal compiler error > on the long snprintf() calls in log.c on the Coldfire. > Ralf discovered that splitting the snprintf call > into multiple ones works around the problem. So this has > a workaround in our tree if you want it. Well. I was thinking even to come up with my own, stripped-down version on snprintf(). Having all the troubles snprintf() caused so far, it might be not that bad idea as it sounds. > Issue #3: General cleanup. Ralf has ifdef'ed out most if not > all of the use of my_XXX for rtems. He also made all non-public > symbols start with _shttp_ to avoid conflicts in statically > linked embedded applications. He added support for using > native MD5 routines since we already had these. And there > was some C99 type cleanup. I beleive that SHTTPD uses static for all private symbols, so it should not interfere with the rest of the your code. You guys using gcc's linker, as far as I know, so it should work as is. sergey ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ shttpd-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shttpd-general
