86 Commits (d2fa5c91a789ee2d11ca3e1ea211e61527af6580)

Author SHA1 Message Date
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
fbernon 3d9c76a69c Minor change (doxygen tags) 19 years ago
goldsimon 7797ada1f5 Added documentation 19 years ago
goldsimon dc515c7ad3 Fixed bug #20287: tcp_output_nagle sends too early. This fixes the nagle algorithm; nagle now also works for all raw API applications and has to be explicitly disabled with 'tcp_pcb->flags |= TF_NODELAY' 19 years ago
fbernon f58515b51e api_msg.c, dns.h, dns.c: Implement DNS_DOES_NAME_CHECK option (check if name received match the name query), implement DNS_USES_STATIC_BUF (the place where copy dns payload to parse the response), return an error if there is no place for a new query, and fix some minor problems. 19 years ago
fbernon edc46281a4 Minor changes on DNS client. 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 2d3a64815f Minor coding style fixes, added comment 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 62b4741b19 Changes for "#20503 IGMP Improvement". Initialize igmp_mac_filter to NULL in netif_add (this field should be set in the netif's "init" function). Use the "imr_interface" field (for socket layer) and/or the "interface" field (for netconn layer), for join/leave operations. The igmp_join/leavegroup first parameter change from a netif to an ipaddr. This field could be a netif's ipaddr, or "any" (same meaning than ip_addr_isany). 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 180e6d2c75 Reset the callbacks and arg (conn) to NULL in do_close_internal(), because 19 years ago
fbernon 2be122875a Minor changes (tabs, ident, coding style...) 19 years ago
marcbou d64b3f21e6 Initialize newconn->state to NETCONN_NONE in accept_function; 19 years ago
fbernon 9152d6671c Comments Fix for Doxygen documentation 19 years ago
fbernon b8b04271b5 Minor fix (warning, linker helper) signaled by Bill Florac 19 years ago
goldsimon f4036e8352 Another fix for bug #20021: by not returning an error if tcp_output fails in tcp_close, the code in do_close_internal gets simpler (tcp_output is called again later from tcp timers). 19 years ago
fbernon a1d8335a8c Fix do_delconn when used with LWIP_TCPIP_CORE_LOCKING=1 on "non-TCP" connections... 19 years ago
goldsimon 62c3de30b9 Fix bug #20480: Check the pcb passed to tcp_listen() for the correct state (must be CLOSED). 19 years ago
fbernon 6a452951f5 api_msg.c: Fix bug #20318: api_msg "recv" callbacks don't call pbuf_free in all error cases. 19 years ago
fbernon a891854ef5 Fix bug #20315: possible memory leak problem if tcp_listen failed, because current code doesn't follow rawapi.txt documentation. 19 years ago
goldsimon 2a77b9fcc7 Bug in last version (fix to close problems): netconn thread might get active before calling its callback, so conn was already deallocated. 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
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 67795ad26e Corrected do_write for LWIP_TCPIP_CORE_LOCKING=1 19 years ago
goldsimon 2aef8bad55 Moved the nagle algorithm from netconn_write/do_write into a define (tcp_output_nagle) in tcp.h to provide it to raw api users, too. 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
goldsimon 261e92c57b In accept_function, one LWIP_ERROR had a wrong expression (since it is inverted compared to LWIP_ASSERT...) 19 years ago
goldsimon 060cbe15d6 Done some work on task #1549 (function documentation), added some LWIP_ERROR checks, don't call pcb_new() from do_bind() and do_connect() since a netconn without pcb can't exist any more (after the recent changes to netconn_new_*()) 19 years ago
goldsimon 15e8208457 pcb_new sets conn->err if protocol is not implemented -> netconn_new_..() does not allocate a new connection for unsupported protocols. 19 years ago
fbernon d81841f54e Minor fix (coding style) 19 years ago
goldsimon 95f4c02381 Included switch LWIP_UDPLITE (enabled by default) to switch off UDP-Lite support if not needed (reduces udp.c code size) 19 years ago
fbernon 090aaefb39 Add LWIP_TCPIP_CORE_LOCKING option (0 as default value) to experiment "locking" as feature to communicate with tcpip_thread for sequential API (netconn & socket layers). Add a alternative code for lwip_sendto to how the code can be optimized with such feature.... 19 years ago
fbernon 953d783a3e api.h, api_lib.c, api_msg.c, sockets.c: group the different NETCONN_UDPxxx code in only one part... 19 years ago
fbernon 499f4689be api.h, api_lib.c, api_msg.h, api_msg.c: change the struct api_msg_msg to see which parameters are used by which do_xxx function, and to avoid "misusing" parameters (patch #5938). 19 years ago
fbernon 2106f491d0 Minors fix (spaces, comments, unused variable) 19 years ago
goldsimon 81ac03a28b Included patch #5938: changed raw_pcb.protocol from u16_t to u8_t since for IPv4 and IPv6, proto is only 8 bits wide. This affects the api, as there, the protocol was u16_t, too. 19 years ago
goldsimon 613644bfc6 Re-included unneeded cases in do_disconnect() and do_send() to prevent warnings. 19 years ago
fbernon 7f5d6bc964 api_msg.c: Fix some errors forwarding (https://savannah.nongnu.org/task/?6880) 19 years ago
fbernon d5e37309e5 Minor Fix (unsed code, spaces, idents..) 19 years ago
goldsimon 8fa3b6802e Added #if !NO_SYS to most of the api files since they only work with a sys layer (makes it easier for port projects). 19 years ago
goldsimon 2740a81103 If a udp_pcb has a local_ip set, check if it is the same as the one of the netif used for sending to prevent sending from old addresses after a netif address gets changed (partly fixes bug #3168). 19 years ago