Commit Graph

223 Commits

Author SHA1 Message Date
goldsimon a412496558 SMTP: disable compilation when LWIP_TCP is disabled 2011-10-21 13:28:01 +02:00
Simon Goldschmidt 288914b5c0 ping: fixed input pbuf processing when using raw API (check p->tot_len before calling pbuf_header) 2011-09-22 21:12:06 +02:00
Simon Goldschmidt d1bf1ee0da httpd + makefsdata:
- added delayed open/read functionality (so that SSI code can delay sending of a file until internal data is available);
- clean up fs-handling: additional read is not required with our current fs implementation;
- kill oldest connection when running out of http_state memory;
- splitted SSI state into its own struct so that non-SSI pages don't consume too much memory (SSI buffer can get quit big);
- added support for HTTP/1.1 persistent connections (use the '-11' switch of makefsdata; not available for SSI files since we cannot calculate the file length in advance);
- splitted the unreadably-long function http_send_data into multiple smaller functions;
2011-09-04 19:26:46 +02:00
Simon Goldschmidt 7413328273 Fix that connections are closed with RST if the HTTP requests didn't fit into the first packet (RST would be sent because not all data has been recved by the httpd - now we ensure all data has been read by waiting for the first double-CRLF before parsing the request) 2011-09-02 22:02:45 +02:00
Simon Goldschmidt 82031caa3c Fixed bug #34170 Memory leak in sntp_send_request() (pbuf used for request was sent to udp but never freed) 2011-09-01 21:08:11 +02:00
Simon Goldschmidt 9a6e57fdbe Added my smtp client using the lwIP raw API 2011-08-24 23:27:16 +02:00
goldsimon 32b341c04a Fix compiler warnings in debug macros 2011-07-06 08:37:01 +00:00
goldsimon cf57b51527 Adapted include path to inet_chksum.c 2011-07-06 07:15:13 +00:00
goldsimon b73187713f httpd: move some variables from rwdata- to rodata- or bss-section 2011-03-27 13:07:48 +00:00
goldsimon 1c84fa5e5d Added unsigned modifier 'U' to defined constants 2011-02-18 13:24:21 +00:00
kieranm c67a905dd9 Fix compile error in httpd.c 2011-02-03 12:44:15 +00:00
goldsimon 61cd545508 Improved debug output on sending data 2010-11-20 17:29:35 +00:00
goldsimon dc0cd64e63 Fix compilation warnings (due to undefined defines) 2010-09-30 10:41:09 +00:00
goldsimon a679e2aec6 - strip '?' from all uris before passing them to fs_open;
- http_close_conn must handle hs==NULL correctly (when called from http_poll);
- added LWIP_HTTPD_ABORT_ON_CLOSE_MEM_ERROR to call tcp_abort when tcp_close fails with out-of-memory error;
- httpd_init checks if the memp pool MEMP_HTTPD_STATE is big enough if HTTPD_USE_MEM_POOL==1
2010-07-19 14:26:36 +00:00
goldsimon c0b51ff573 Fixed HTTP header for 400 (Bad Request) and 501 (Not Implemented) 2010-07-07 08:17:12 +00:00
goldsimon 5afec09b38 Fixed compilation for LWIP_HTTPD_POST_MANUAL_WND==0 2010-07-06 20:24:36 +00:00
goldsimon 19de161358 - added LWIP_HTTPD_SSI_INCLUDE_TAG (default on): when off, don't include the SSI tag in the output sent to clients (so SSI tags can be used anywhere, even in input boxes);
- fixed copy/nocopy for SSI files;
- added LWIP_HTTPD_SSI_MULTIPART (default off): when on, SSI functions have one more argument that is used as state for an SSI tag to return more than LWIP_HTTPD_MAX_TAG_INSERT_LEN bytes (the handler function is then called multiple times);
- added LWIP_HTTPD_POST_MANUAL_WND (default off): when on, post callbacks can throttle RX speed by manually sending window updates (i.e. tcp_recved is called manually by calling httpd_post_data_recved);
- added LWIP_HTTPD_FILE_STATE (default off): when on, fs_open/fs_close call application defined functions fs_state_init/fs_state_free (fs_state_init returns a void pointer that is passed to every call to an SSI handler);
- compacted the code a bit by moving the code that calls tcp_write() in a loop to its own function;
- error files may have the extension shtml, too;
- fixed that returning default 404 page did not work any more;
2010-07-05 14:32:24 +00:00
goldsimon 4adc78384b Minor: added newlines in console output 2010-07-05 14:21:50 +00:00
kieranm 0d1f02f931 Don't use local variable index as it clashes with global string.h define 2010-06-28 13:46:17 +00:00
goldsimon bcf978f58d fixed compiler warning: use size_t, not int 2010-06-25 18:42:17 +00:00
goldsimon 04cbdfe912 Use the packed version of ip_addr_t in struct netbios_name_hdr 2010-06-14 16:04:57 +00:00
goldsimon c7acce523a fixed signed/unsigned comparision, fixed indentation 2010-05-17 12:19:42 +00:00
goldsimon 3a06d130c3 performance improvements:
- don't stop sending after inserting a tag (leads to delayed ACKs);
- enqueue FIN in last data packet;
fix usage of tcp_close() after correcting close vs. shutdown
2010-05-17 11:20:59 +00:00
goldsimon 2de3924493 Added missing #if LWIP_HTTPD_CUSTOM_FILES 2010-05-17 11:07:43 +00:00
goldsimon debf0134df Fixed compilation for LWIP_HTTPD_DYNAMIC_HEADERS==1, fixed a few warnings, changed the init code a bit 2010-05-16 16:18:39 +00:00
goldsimon 3e59a70f02 Added LWIP_HTTPD_CUSTOM_FILES to open files that are not included in fsdata.c 2010-05-16 16:15:15 +00:00
goldsimon 35b0b78242 Fix a compiler warning 2010-05-16 16:07:11 +00:00
goldsimon 3fa77d67be Use the new PP_HTONx macros 2010-05-16 16:05:41 +00:00
goldsimon 672f01f4e3 Fixed compilation for PING_USE_SOCKETS==0 2010-05-10 14:08:14 +00:00
goldsimon 4b47d17a37 -f argument handler didn't copy the full filename ... :-) 2010-04-01 13:02:58 +00:00
goldsimon 62ea62ffc3 Fixed compiler warnings 2010-04-01 12:57:45 +00:00
goldsimon 30d352cec7 Don't include any directory starting with a dot (to not include my ".svn" directories), added parameter "-f:<filename>" to output to another file than the default "fsdata.c" 2010-04-01 12:49:08 +00:00
goldsimon 2689478bbb Fixed compilation under WIN32 (htons etc. was duplicate) 2010-04-01 12:25:46 +00:00
goldsimon 9db401aa63 Added HTTPD_USE_CUSTUM_FSDATA to include "fsdata_custom.c" instead of "fsdata.c" for the file system (to prevent changing the file included in CVS) 2010-04-01 12:19:18 +00:00
goldsimon 57c1f7a16d Fixed compilation with LWIP_UDP/LWIP_TCP disabled 2010-03-26 16:10:32 +00:00
goldsimon 581b363d79 Make shell work with some or all stats disabled, too 2010-03-26 15:48:28 +00:00
goldsimon 64763950ca Fixed invalid assertion in error() 2010-03-26 14:44:20 +00:00
goldsimon c2f3fcc72a Set LWIP_HTTPD_STRNSTR_PRIVATE on by default, prevent old-style function declaration 2010-03-26 14:16:04 +00:00
goldsimon bafc19addd make some char-pointer-arrays const, add default cases on all switches 2010-03-26 14:11:55 +00:00
goldsimon d8f5406985 make udpecho_thread() static 2010-03-26 14:11:19 +00:00
goldsimon 9349f269e6 Remove duplicate prototype of httpd_init() 2010-03-26 14:10:50 +00:00
goldsimon fbee0f5c56 Don't limit maximum body length in post, added TRACE to some debug outputs 2010-03-26 13:42:37 +00:00
goldsimon 321578fd14 Fixed compilation: removed extra tokens after #endif, which MSVC doesn't complain about :-( 2010-03-25 10:32:12 +00:00
goldsimon 71b0d509dc minor coding style: strnstr: added brackets 2010-03-22 15:48:23 +00:00
goldsimon 7ea6692cdb Don't call tcp_close right after all data is enqueue, since this may result in resetting the connection (because of task #10088) 2010-03-22 12:26:40 +00:00
goldsimon 75d9fdc5c7 Initialize the listen pcb's prio correctly, added missing cast and include, http_poll: don't check for pcb->state 2010-03-22 10:07:36 +00:00
goldsimon 0035c0f119 Added support for POST, HTTP/0.9 and extended status files (e.g. "/501.html") 2010-03-21 15:42:59 +00:00
goldsimon 298991e83b Added option LWIP_HTTPD_SUPPORT_EXTSTATUS 2010-03-20 13:50:26 +00:00
goldsimon f779310da6 Support request that are spanned over multiple packets/pbufs (disabled by default to save space), use memcpy instead of snprintf 2010-03-20 13:35:53 +00:00
goldsimon 93a0e58ea2 Added support for precalculated checksum and (pregenerated) HTTP/1.1 headers ("connection: close" and "content-length") 2010-03-18 06:34:35 +00:00
goldsimon 111004caa9 Fixed compilation for CGI, SSI and DYNAMIC_HEADERS, renamed variables, added comments 2010-03-18 06:31:18 +00:00
goldsimon 9ae87c50d2 Fixed warning about unused local variable in release mode 2010-03-15 09:45:20 +00:00
goldsimon 05c30ba213 Speed up generating big files 2010-03-14 13:25:49 +00:00
goldsimon 3a30b8350d Use tcp_mss(pcb) instead of pcb->mss; only call tcp_output from http_poll 2010-03-13 15:02:22 +00:00
goldsimon 3f79779a0f Added connection timing, changed default definition of HTTP_IS_DATA_VOLATILE() to not copy data when sending from unmodified files 2010-03-12 19:26:57 +00:00
goldsimon b83a115953 Fixed compilation warnings (missing casts, includes, etc.) 2010-03-10 11:27:11 +00:00
goldsimon e97f6e1909 Improved code size & memory footprint when LWIP_HTTPD_SSI==0 && LWIP_HTTPD_DYNAMIC_HEADERS==0 2010-03-08 18:58:21 +00:00
goldsimon 91cd7becdf bug #29105: Review printf formatters 2010-03-08 17:10:12 +00:00
goldsimon 8cd0218330 Added test for multiple selects (disabled by default) 2010-03-07 18:45:27 +00:00
goldsimon 5196e5ba4f Copy errno to a local variable for debugging 2010-03-06 12:14:44 +00:00
goldsimon 71c643ae61 shell_main: use netconn_recv_tcp_pbuf() instead of netconn_recv() 2010-03-06 12:13:46 +00:00
goldsimon 0116d1c3a1 Fixed code-violation that checkmycode.org warns about :-) 2010-03-04 17:45:37 +00:00
goldsimon cb7f0de9f8 Fixed bug #29068: Fixed memory leak in ping_recv for PING_USE_SOCKETS==0 2010-03-04 15:48:21 +00:00
goldsimon 6bb0cded4f For LWIP_HTTPD_DYNAMIC_HEADERS==1, skip get_http_headers() if http_header_included 2010-02-24 11:51:05 +00:00
goldsimon 2a41542edb LWIP_HTTPD_DYNAMIC_HEADERS defaults to 0 2010-02-20 17:48:57 +00:00
goldsimon 0b541d8f0a HTTPD_DEBUG defaults to off 2010-02-20 17:48:43 +00:00
goldsimon 1f93022b83 Moved some parts of the HTTP-header related code to a new file to share it between httpd.c and makefsdata.c, regenerated fsdata.c 2010-02-19 16:20:25 +00:00
goldsimon 4ec673b17d Merged httpd from TI Luminary: added basic SSI and CGI support, added support for dynamic HTTP header generation 2010-02-17 21:19:17 +00:00
goldsimon 44374b26da typo: 609 -> 509 2010-02-17 16:51:45 +00:00
goldsimon 670e347eed added missing newline before EOF 2010-02-17 16:48:34 +00:00
goldsimon 56d3d5c39a help_msg is split into 2 strings to prevent exceeding the C89 maximum length of 509 per string 2010-02-17 16:48:23 +00:00
goldsimon a50dd0cc7b Use new macro ip_addr_copy 2010-02-14 12:44:48 +00:00
goldsimon 2027a11331 Use the new fcntl(), too 2010-02-13 15:56:53 +00:00
goldsimon 8f62d0525c Fixed packing of struct rtp_hdr 2010-02-13 14:47:41 +00:00
goldsimon 8a8f2f762c Added test for closing socket in nonblocking connect 2010-02-12 17:00:05 +00:00
goldsimon 5397ecfbca Added comment 2010-02-12 16:59:50 +00:00
goldsimon a139f72602 Added a function to test recv timeout and correct closing 2010-02-09 20:13:32 +00:00
goldsimon fc7b8e1fc2 Add printf for feedback when all tests are done 2010-02-09 18:39:19 +00:00
goldsimon e46c1c88e9 Added guard to only compile if LWIP_SOCKET is enabled 2010-02-09 17:51:11 +00:00
goldsimon c1c78c4c9e Added guard to only compile if LWIP_NETCONN is enabled 2010-02-09 17:50:57 +00:00
goldsimon b5212c5d60 Don't use C++ comments 2010-02-09 13:18:08 +00:00
goldsimon c4fb6238a0 Support for case insensitiva comparision of NETBIOS_LWIP_NAME 2010-02-05 10:56:47 +00:00
goldsimon a6828003d8 Replaced struct ip_addr by typedef ip_addr_t to make changing the actual implementation behind the typedef easier. 2010-02-04 18:50:12 +00:00
goldsimon 87c6d6324e Check that netconn_new doesn't fail 2010-02-04 17:23:46 +00:00
goldsimon 899ae6a321 Use macros defined in ip_addr.h (some of them new) to work with IP addresses (preparation for bug #27352 - Change ip_addr from struct to typedef (u32_t) - and better code). 2010-02-04 17:23:30 +00:00
goldsimon 880ed2c01e Moved lwip_prvmib.c and private_mib.h from unix/proj/minimal to apps/snmp_private_mib and extended it for write support and usage with memory buffers instead of files to be used under non-posix OSes as an example 2010-02-02 19:39:25 +00:00
goldsimon 103def2a7e Don't use C++ style comments 2010-01-29 23:17:39 +00:00
goldsimon 54870b94ea Added socket example both for users to get started and to ASSERT/test basic socket behavior 2010-01-29 23:13:23 +00:00
goldsimon 003f79774e Graceful shutdown of netconn-httpd on error 2010-01-29 23:11:06 +00:00
goldsimon aa0ae95b4e Adapted to changed inet.h/ip_addr.h/def.h 2010-01-29 08:24:08 +00:00
goldsimon cceacccce6 Adapted to changed inet.h/ip_addr.h/def.h, fixed warnings 2010-01-29 08:22:40 +00:00
goldsimon 185eb9663f Coding style: don't use reserved C++ keywords (since many editors can't differ between a C and a C++ file); bug #28659: Missing casts 2010-01-25 08:21:33 +00:00
goldsimon 892859455c bug #28659: Missing casts 2010-01-25 08:20:46 +00:00
goldsimon 448dd70ced Added raw-api tcp echo server from unix/minimal 2010-01-24 17:12:29 +00:00
goldsimon dbee3cf464 (Experimental) support for echoing typed characters (to see what you typed in telnet), doesn't really work reliably yet... 2010-01-24 13:31:14 +00:00
goldsimon 5af75e5b01 Portability: support "\n" or "\r\n" for newline to correctly print on win32 telnet 2010-01-24 13:30:00 +00:00
goldsimon 566a3ad2ca Fix TCP handling: command doesn't have to be contained in a single packet but remote side has to enter \r or \n to finish a command, this supports the other end being a (hand-typed) telnet session 2010-01-24 13:28:10 +00:00
goldsimon 409e10ca8f bug #26523: Compiler Warnings 2010-01-24 13:26:13 +00:00
goldsimon faf826ad6d bug #26523: Compiler Warnings 2010-01-24 10:09:57 +00:00
goldsimon d20a5e8b29 Fixed warnings and wrong asserts 2010-01-21 07:30:17 +00:00