The webserver/httpd app is currently broken when script support is enabled (CONFIG_NETUTILS_HTTPD_SCRIPT_DISABLE). The root cause has been tracked down to the "Content-length" not being available ahead of time in this case (length of -1 passed to send_headers() ). On the other hand, the server closing the socket does not result in FIN being sent to the browser either (FIN not supported by NuttX yet).
Simple solution: Add support for HTTP Chunked Encoding to webserver/httpd (attached patch).
The attached patch is simple. It adds a configuration option to enable chunked encoding. When enabled, the implementation will auto-detect the cases where content length is not available ahead of time, and will automatically engage chunked encoding transfers.
Without this patch, the browser/client hangs forever, as it is expecting more data. With this patch, the browser displays the content.
NxWidgets improvements
* NxWidgets: fix garbage returned when CCycleButton::getValue() is called after removeAllOptions().
It's a bit questionable whether returning 0 here is reasonable or
if it would be better to assert(). But either is better than reading
into random memory and returning a garbage value.
* NXWidgets CScrollingPanel: Don't draw outside the widget area.
The port->move() function doesn't support clipping the
copied area to the client area, so we have to manually
calculate the part that can be moved without going outside
the widget.
* CNxString: Add string + operator and ::format() function
* CNumericEdit: Add option to include unit name after the value
* NxWidgets: CNxWidget: Make useWidgetStyle() public
Makes it easier to update styles when multiple controls are nested.
* NxWidgets: Add CLabelGrid control for displaying text in grid format.
Approved-by: GregoryN <gnutt@nuttx.org>
Reviewers note: Reviewing the changes I also see that these file did not follow the NuttX codings standard. I ran all files through nuttx/tools/indent.sh, manually reviewed all files for coding style issues. I also changed occurrences of non-standard types u8_t, u16_t, and u32_t to the standard uint8_t, uint16_t, and uint32_t.
Squashed commit of the following:
Clean-up some include path problems introduced with the previous set of changes.
app/include/graphics, apps/NxWidgets/UnitTests: Update include paths for file in new location.
apps/NxWidgets/nxwidgets and nxwm: Update include paths for file in new location.
apps/graphics/NxWidgets: Move nxwidgets and nxwm include/ directories to apps/include/graphics
- fix error "sz_main.o: No such file or directory"
- support -p <path> for rz to change the folder for the recevied file
- switch debug output from printf to syslog
- send the next packet for ZME_ACK in ZMS_SENDING to avoid rz on the host side stuck
- make send work reliable even without hardware flow control
testing: add Unity - unit testing library from ThrowTheSwitch.org
* examples/powerled: add arch initialization; examples/smps: fixes in some printf and in Kconfig
* testing: add Unity - unit testing library from ThrowTheSwitch.org
Approved-by: GregoryN <gnutt@nuttx.org>
apps/examples/ft80x: Fix some size calculations. Add option to disable primitive tests... just too boring to have to watch over and over again.
apps/graphics/ft80x: Fix a typo in backlight fade logic; Fix error in formmatted display light debug dump output.
apps/graphics/ft80x: Fix some warnings when debug features are enabled.
apps/graphics/ft80x: Replace polling logic with gentler signal logic when waitinf for the CMD FIFO to become empty.
apps/examples/ft80x: Add first co-processor example.
apps/graphics: Extend library to manage display lists either in display memory (RAM DL) or provided directly to th co-processor FIFO (RAM CMD).
apps/examples/ft80x: Some minor clean-up. Trivial changes for coprocessor support.
apps/graphics/ft80x: Add support for accessing graphics ram. apps/examples/ft80x: Add more primitive graphics demos.
apps/examples/ft80x: Add a couple more demos of primitives. Use new ft80x_dl_create() to simplify.
apps/graphics/ft80x: Add ft80x_dl_create() which simplies writing of very simple display lists.
apps/examples/lvgldemo: Fix up some include paths
apps/examples/lvgldemo: The last final now conforms to the NuttX coding style.
apps/graphics/littlevgl: Two more files are closer to the NuttX coding style.
apps/graphics/littlevgl: Two more files are closer to the NuttX coding style.
apps/examples/lvgldemo: Three more files are closer to the NuttX coding style.
apps/examples/lvgldemo: Two more files are closer to the NuttX coding style.
apps/examples/lvgldemo: Two more files are closer to the NuttX coding style.
Add include/graphics/.gitignore
apps/include/graphics: Remove lvgl.h. graphics/littlevgl/Makefile now copies the file into position.
apps/graphics/littlevgl: Add .gitignore file
apps/graphics/littlevgl: Most of these files follow the coding style now.
apps/graphics/littlevgl: This gets a couple of files closer to the NuttX coding style.
apps/examples/lvgldemo: Add lvgldemo example
apps/graphics/littlevgl: Add littlevgl library
FTP: Adds support for IPv6 and fixes various transfer issues
* netutils/ftpd: Fix support for IPv6 FTP server
* netutils/ftpc:Adds support for IPv6 sockets
* ftpc: Must convert port received by EPSV reply to network order
* ftpc: Data socket address for passive connection should be same as server address
* ftpc: Must skip human readable string in EPSV response before scanning for port
* ftpc: Don't send PASS command if USER command was sufficient. ie no password required
* ftpc: Generically handle permanent negative completion in shard ftpc_cmd logic
* ftpc: Minor addresssing fix
* ftpc: Tweak logic for overriding network debugging output
* FTP: Adds option for setting stack size of various threads in FTPD and FTPC
* netutils/ftpd: Fixes build error setting IPv4 address. sin_addr => sin_addr.s_addr
* netutils/ftpd: Protects against partial write returns by looping in that case
Approved-by: Gregory Nutt <gnutt@nuttx.org>