mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-26 08:02:51 +00:00
sys_thread_new() now returns the thread (request from Marc Boucher).
Removed some unused .h files in coldfire port. Support LWIP_DIAG and LWIP_ASSERT in coldfire (sort of). Fix to last api fix to make sure select() is triggered, even when there has been a FIN. Allow build of unixsim from cygwin by specifying "make ARCH=cygwin" or from linux by specifying "make ARCH=linux".
This commit is contained in:
parent
848dea2058
commit
7b3e158c92
@ -467,6 +467,7 @@ netconn_recv(struct netconn *conn)
|
|||||||
struct api_msg *msg;
|
struct api_msg *msg;
|
||||||
struct netbuf *buf;
|
struct netbuf *buf;
|
||||||
struct pbuf *p;
|
struct pbuf *p;
|
||||||
|
u16_t len;
|
||||||
|
|
||||||
if(conn == NULL) {
|
if(conn == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -497,12 +498,17 @@ netconn_recv(struct netconn *conn)
|
|||||||
|
|
||||||
sys_mbox_fetch(conn->recvmbox, (void **)&p);
|
sys_mbox_fetch(conn->recvmbox, (void **)&p);
|
||||||
|
|
||||||
if (p != NULL) {
|
if (p != NULL)
|
||||||
conn->recv_avail -= p->tot_len;
|
{
|
||||||
|
len = p->tot_len;
|
||||||
|
conn->recv_avail -= len;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
len = 0;
|
||||||
|
|
||||||
/* Register event with callback */
|
/* Register event with callback */
|
||||||
if (conn->callback)
|
if (conn->callback)
|
||||||
(*conn->callback)(conn, NETCONN_EVT_RCVMINUS, p->tot_len);
|
(*conn->callback)(conn, NETCONN_EVT_RCVMINUS, len);
|
||||||
}
|
|
||||||
|
|
||||||
/* If we are closed, we indicate that we no longer wish to recieve
|
/* If we are closed, we indicate that we no longer wish to recieve
|
||||||
data by setting conn->recvmbox to SYS_MBOX_NULL. */
|
data by setting conn->recvmbox to SYS_MBOX_NULL. */
|
||||||
|
@ -42,6 +42,7 @@ static err_t
|
|||||||
recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
|
recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
|
||||||
{
|
{
|
||||||
struct netconn *conn;
|
struct netconn *conn;
|
||||||
|
u16_t len;
|
||||||
|
|
||||||
conn = arg;
|
conn = arg;
|
||||||
|
|
||||||
@ -54,11 +55,14 @@ recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
|
|||||||
|
|
||||||
conn->err = err;
|
conn->err = err;
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
conn->recv_avail += p->tot_len;
|
len = p->tot_len;
|
||||||
|
conn->recv_avail += len;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
len = 0;
|
||||||
/* Register event with callback */
|
/* Register event with callback */
|
||||||
if (conn->callback)
|
if (conn->callback)
|
||||||
(*conn->callback)(conn, NETCONN_EVT_RCVPLUS, p->tot_len);
|
(*conn->callback)(conn, NETCONN_EVT_RCVPLUS, len);
|
||||||
}
|
|
||||||
sys_mbox_post(conn->recvmbox, p);
|
sys_mbox_post(conn->recvmbox, p);
|
||||||
}
|
}
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
|
@ -114,7 +114,7 @@ u32_t sys_arch_protect(void);
|
|||||||
void sys_arch_unprotect(u32_t pval);
|
void sys_arch_unprotect(u32_t pval);
|
||||||
|
|
||||||
/* Thread functions. */
|
/* Thread functions. */
|
||||||
void sys_thread_new(void (* thread)(void *arg), void *arg);
|
sys_thread_t sys_thread_new(void (* thread)(void *arg), void *arg);
|
||||||
|
|
||||||
/* The following functions are used only in Unix code, and
|
/* The following functions are used only in Unix code, and
|
||||||
can be omitted when porting the stack. */
|
can be omitted when porting the stack. */
|
||||||
|
Loading…
Reference in New Issue
Block a user