Change the definition of the P() macro under the AVR architecture to store the strings in sections named after the variables. This allows unused strings to be removed by the linker, saving space in the flash memory. Also change the variable name for all but one of the instances of failMsg to give the maximum benefit from the above.
…nt to EthernetClient() anyway
Hi again. Here is a summary of the changes - The recent patches did not compile. On Arduino 1.0.5 MAX_SOCK_NUM was missing so I included ethernet.h - I added back write(const uint8_t *buffer, size_t size) which was removed with the addition of buffering - I added printf for convenience - I made reset & flushBuf public. I'll continue to use the current version and report any bugs. I think that it may be a good time to up the version number Thanks
Update WebServer::write(uint8_t) to write to a buffer instead of sending single characters (or short strings) as small packets. Remove the other signatures of write so that the base ones in the Print class (which call write(uint8_t)) are used instead and simplify the writeP/printP definitions to do this too. This greatly improves the performance of pages which are built from a large number of small strings or values at the expense of a small additional amount of memory (which can be adjusted with the use of a new macro called WEBDUINO_OUTPUT_BUFFER_SIZE) and also saves ~85 bytes of flash.
The Command prototype has a char* parameter for the URL tail, but WebServer::dispatchCommand calls this with an empty string as a parameter if there is no URL. As gcc treats empty strings as const char*s this causes a warning to be emitted when compiling using -Wall, so suppress it by explicitly casting it to char*.
Convert some of the int and char variables to be unsigned int and unsigned char types. This prevents gcc generating the warnings "comparison between signed and unsigned integer expressions" and "array subscript has type 'char'", as well as having a nice side-effect of shaving 42 bytes off the compiled size when building for the Uno.
Remove the typedef storage class specifier from the declaration of the URLPARAM_RESULT enum as this is not required and causes gcc to emit the warning "'typedef' was ignored in this declaration" when compiling with -Wall.