103 Commits (e58f4c567a0b5953be9f69d2b29bf7fbd104daee)

Author SHA1 Message Date
goldsimon e58f4c567a Add non-blocking support for connect (partly from patch #6860) plus many cleanups in socket & netconn API 16 years ago
goldsimon 32c16fad42 igmp related: renamed netif pointers from 'interface' to 'netif' to not use keywords (or at least my editor highlights it as one...) 16 years ago
goldsimon e678e1bdcb bug #28659: Missing casts 16 years ago
goldsimon cc1e9370af Minor: fixed argument casts for mbox_fetch parameters (to fix compiler warnings) 16 years ago
goldsimon 34139606ca task #10102: "netconn: clean up conn->err threading issues" by adding error return value to struct api_msg_msg 16 years ago
goldsimon ca11baf1cd Changed netconn_recv() and netconn_accept() to return err_t (bugs #27709 and #28087) 16 years ago
goldsimon 0e38a52edc Again: Fixed bug #26672 (close connection when receive window = 0) by correctly draining recvmbox/acceptmbox 16 years ago
goldsimon 533e6b5f8d Fixed bug #26672 (close connection when receive window = 0) by correctly draining recvmbox/acceptmbox 16 years ago
goldsimon a9740c6a44 Fixed bug #27709: conn->err race condition on netconn_recv() timeout by directly returning when sys_arch_mbox_fetch times out. 17 years ago
goldsimon 27b28a9306 Converted netconn_type() from a function to a macro 17 years ago
goldsimon c05e968278 Fixed many LWIP_DEBUGF format strings; added new format string SZT_F for size_t 17 years ago
goldsimon 14cb4eb735 fixed arguments of socket functions to match the standard; converted size argument of netconn_write to 'size_t' for that; fixed some warnings 17 years ago
fbernon 55bcc20deb tcpip.h, tcpip.c, api.h, api_lib.c, api_msg.c, sockets.c: replace the field netconn::sem per netconn::op_completed like suggested for the task #7490 "Add return value to sys_mbox_post". 18 years ago
fbernon bceff76c70 tcpip.h, tcpip.c, api.h, api_lib.c, api_msg.c, sockets.c: replace the field netconn::mbox (sys_mbox_t) per netconn::sem (sys_sem_t) for the task #7490 "Add return value to sys_mbox_post". 18 years ago
goldsimon a41f113b8f Added function netconn_free(), which deallocates all mboxes and frees the netconn (to be used from different places) - the PCB is not freed! 18 years ago
fbernon 5941b3c86e sys_arch.txt, api.h, api_lib.c, api_msg.h, api_msg.c, tcpip.c, sys.h, opt.h: Introduce changes for task #7490 "Add return value to sys_mbox_post" with some modifications in the sys_mbox api: sys_mbox_new take a "size" parameters which indicate the number of pointers query by the mailbox. There is three defines in opt.h to indicate sizes for tcpip::mbox, netconn::recvmbox, and for the netconn::acceptmbox. Port maintainers, you can decide to just add this new parameter in your implementation, but to ignore it to keep the previous behavior. The new sys_mbox_trypost function return a value to know if the mailbox is full or if the message is posted. Take a look to sys_arch.txt for more details. This new function is used in tcpip_input (so, can be called in an interrupt context since the function is not blocking), and in recv_udp and recv_raw. 18 years ago
fbernon 9c4daa312d Minor changes in lwip folder: fix some warnings, coding style, and rename "internal" netconn_alloc function. 18 years ago
fbernon 32005617b9 rawapi.txt, api.h, api_lib.c, api_msg.h, api_msg.c, sockets.c, tcp.h, tcp.c, tcp_in.c, init.c, opt.h: rename backlog options with TCP_ prefix, limit the "backlog" parameter in an u8_t, 0 is interpreted as "smallest queue", add documentation in the rawapi.txt file. 18 years ago
goldsimon 1ed34774c8 tcp.h, opt.h, api.h, api_msg.h, tcp.c, tcp_in.c, api_lib.c, api_msg.c, sockets.c, init.c: task #7252: Implement TCP listen backlog: Warning: raw API applications have to call 'tcp_accepted(pcb)' in their accept callback to keep accepting new connections. 19 years ago
goldsimon 48e62e25e9 sys.h, api_lib.c, api_msg.c, sockets.c: fix bug #21698: "netconn->recv_avail is not protected" by using new macros for interlocked access to modify/test netconn->recv_avail. 19 years ago
goldsimon ba4254231e Corrected assert when netconn_new_* fails 19 years ago
goldsimon 113a52d091 fix bug #21656 (recvmbox problem in netconn API): always allocate a recvmbox in netconn_new_with_proto_and_callback. For a tcp-listen netconn, this recvmbox is later freed and a new mbox is allocated for acceptmbox. This is a fix for thread-safety and allocates all items needed for a netconn when the netconn is created. 19 years ago
goldsimon 6746beb2a3 Compacted code: moved the code creating a netconn (without pcb) from netconn_new_with_proto_and_callback to new (synchroneous) function netconn_alloc_with_proto_and_callback and call this function from netconn_new_with_proto_and_callback and accept_function. 19 years ago
goldsimon 03777ccb21 Changed error handling: ERR_MEM, ERR_BUF and ERR_RTE are seen as non-fatal, all other errors are fatal. netconns and sockets block most operations once they have seen a fatal error. 19 years ago
goldsimon 4dcfdac2f5 initialize netconn->socket to -1 instead of 0 since 0 is a valid socket! 19 years ago
fbernon 3d9c76a69c Minor change (doxygen tags) 19 years ago
goldsimon e7483f2e64 Added return value comments to netconn_gethostbyname 19 years ago
goldsimon e2cd201f6a Added sequential dns resolver function for netconn api (netconn_gethostbyname) 19 years ago
fbernon a4d14722f3 sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c: Fixed bug #20900. Now, most of the netconn_peer and netconn_addr processing is done inside tcpip_thread context in do_getaddr. 19 years ago
goldsimon f3dbd986cb Task #7410: Removed the need to include core header files in api.h (ip/tcp/udp/raw.h) to hide the internal implementation from netconn api applications. 19 years ago
fbernon ecce865cfe api.h, api_lib.c, api_msg.c, sockets.c, opt.h: add SO_RCVBUF option for UDP & RAW netconn. You need to set LWIP_SO_RCVBUF=1 in your lwipopts.h (it's disabled by default). Netconn API users can use the netconn_recv_bufsize macro to access it. This is a first release which have to be improve for TCP. Note it used the netconn::recv_avail which need to be more "thread-safe" (note there is already the problem for FIONREAD with lwip_ioctl/ioctlsocket). 19 years ago
fbernon cbe9b050a9 sockets.h, sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c, tcp.h, tcp_out.c: Integrate "patch #6250 : MSG_MORE flag for send". MSG_MORE is used at socket api layer, NETCONN_MORE at netconn api layer, and TCP_WRITE_FLAG_MORE at raw api layer. This option enable to delayed TCP PUSH flag on multiple "write" calls. Note that previous "copy" parameter for "write" APIs is now called "apiflags". 19 years ago
fbernon 7077d51f1f api.h, api_lib.c, api_msg.c: Add macro API_EVENT in the same spirit than TCP_EVENT_xxx macros to get a code more readable. It could also help to remove some code (like we have talk in "patch #5919 : Create compile switch to remove select code"), but it could be done later. 19 years ago
goldsimon 270c7c1110 Removed check for conn->err for functions whose counterparts in api_msg.c also do the check (1. remove redundant code, 2. check is better done in tcpip thread context) 19 years ago
goldsimon b1a4b00091 Preprocessor statements have to start at the beginning of a line for old compilers! 19 years ago
fbernon 87e16a8f47 sockets.c, api.h, api_lib.c: First step to fix "bug #20900 : Potential crash error problem with netconn_peer & netconn_addr". VERY IMPORTANT: this change cause an API breakage for netconn_peer, since a parameter type change. Any compiler should cause an error without any changes in yours netconn_peer calls (so, it can't be a "silent change"). It also reduce a little bit the footprint for socket layer (lwip_getpeername & lwip_getsockname use now a common lwip_getaddrname function since netconn_peer & netconn_addr have the same parameters). 19 years ago
fbernon 95f2d48ac4 Avoid to lost previous error codes in sockets.c and api_lib.c. 19 years ago
fbernon e3cd1ac1f9 Minor changes (but in lot of files): add #if/#endif for options where they could miss. #if LWIP_xxx if always put after #include "lwip/opt.h" (note this one indirectly include cc.h). Move others includes inside #if/#endif block. 19 years ago
fbernon 245bce04d1 Add netbuf.h, netbuf.c, Change api.h, api_lib.c: #7249 "Split netbuf functions from api/api_lib". Now netbuf API is independant of netconn, and can be used with other API (application based on raw API, or future "socket2" API). Ports maintainers just have to add src/api/netbuf.c in their makefile/projects. 19 years ago
fbernon 54c1025ec0 First fix for "bug #20900 : Potential crash error problem with netconn_peer & netconn_addr". Introduce NETCONN_LISTEN netconn_state and remove obsolete ones (NETCONN_RECV & NETCONN_ACCEPT). 19 years ago
marcbou 07223bf5ef Backed out last change to netconn_delete() after discussion with Frederic. 19 years ago
marcbou 17f07a36ef netconn_delete(): unblock potentially waiting recv. 19 years ago
fbernon 9152d6671c Comments Fix for Doxygen documentation 19 years ago
goldsimon f9c30017b0 Fixed bug #20429: use the new pbuf_copy_partial instead of the old copy_from_pbuf, which illegally modified the given pbuf; Introduced pbuf_copy_partial, making netbuf_copy_partial use this function. 19 years ago
goldsimon eb875de67e Added assertions where PBUF_RAM pbufs are used and an assumption is made that this pbuf is in one piece (i.e. not chained). These assumptions clash with the possibility of converting to fully pool-based pbuf implementations, where PBUF_RAM pbufs might be chained. 19 years ago
goldsimon 9a4a5b1816 Final fix for bug #20021 and some other problems when closing tcp netconns: removed conn->sem, less context switches when closing, both netconn_close and netconn_delete should safely close tcp connections. 19 years ago
fbernon af71292aba Minor fix (extra spaces) 19 years ago
goldsimon bb9e9e5480 Changed the expression of LWIP_ERROR to the same as for LWIP_ASSERT 19 years ago
goldsimon f49fc35f55 Converted the length argument of netconn_write (and therefore also api_msg_msg.msg.w.len) from u16_t into int to be able to send a bigger buffer than 64K with one time (mainly used from lwip_send). 19 years ago
goldsimon 9f05cabf87 Fixed bug #20021: Moved sendbuf-processing in netconn_write from api_lib.c to api_msg.c to also prevent multiple context-changes on low memory or empty send-buffer. 19 years ago