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:
davidhaas 2003-02-11 21:00:14 +00:00
parent 848dea2058
commit 7b3e158c92
3 changed files with 22 additions and 12 deletions

View File

@ -467,6 +467,7 @@ netconn_recv(struct netconn *conn)
struct api_msg *msg;
struct netbuf *buf;
struct pbuf *p;
u16_t len;
if(conn == NULL) {
return NULL;
@ -497,12 +498,17 @@ netconn_recv(struct netconn *conn)
sys_mbox_fetch(conn->recvmbox, (void **)&p);
if (p != NULL) {
conn->recv_avail -= p->tot_len;
/* Register event with callback */
if (conn->callback)
(*conn->callback)(conn, NETCONN_EVT_RCVMINUS, p->tot_len);
if (p != NULL)
{
len = p->tot_len;
conn->recv_avail -= len;
}
else
len = 0;
/* Register event with callback */
if (conn->callback)
(*conn->callback)(conn, NETCONN_EVT_RCVMINUS, len);
/* If we are closed, we indicate that we no longer wish to recieve
data by setting conn->recvmbox to SYS_MBOX_NULL. */

View File

@ -42,7 +42,8 @@ static err_t
recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
{
struct netconn *conn;
u16_t len;
conn = arg;
if(conn == NULL) {
@ -54,11 +55,14 @@ recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
conn->err = err;
if (p != NULL) {
conn->recv_avail += p->tot_len;
/* Register event with callback */
if (conn->callback)
(*conn->callback)(conn, NETCONN_EVT_RCVPLUS, p->tot_len);
}
len = p->tot_len;
conn->recv_avail += len;
}
else
len = 0;
/* Register event with callback */
if (conn->callback)
(*conn->callback)(conn, NETCONN_EVT_RCVPLUS, len);
sys_mbox_post(conn->recvmbox, p);
}
return ERR_OK;

View File

@ -114,7 +114,7 @@ u32_t sys_arch_protect(void);
void sys_arch_unprotect(u32_t pval);
/* 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
can be omitted when porting the stack. */