mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-03 04:54:38 +08:00
Minor fix (extra spaces)
This commit is contained in:
parent
24e29cecae
commit
af71292aba
@ -256,7 +256,7 @@ netbuf_copy_partial(struct netbuf *buf, void *dataptr, u16_t len, u16_t offset)
|
|||||||
if(buf == NULL || dataptr == NULL) {
|
if(buf == NULL || dataptr == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
|
/* Note some systems use byte copy if dataptr or one of the pbuf payload pointers are unaligned. */
|
||||||
for(p = buf->p; len != 0 && p != NULL; p = p->next) {
|
for(p = buf->p; len != 0 && p != NULL; p = p->next) {
|
||||||
if ((offset != 0) && (offset >= p->len)) {
|
if ((offset != 0) && (offset >= p->len)) {
|
||||||
@ -303,7 +303,7 @@ netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto,
|
|||||||
if (conn == NULL) {
|
if (conn == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn->err = ERR_OK;
|
conn->err = ERR_OK;
|
||||||
conn->type = t;
|
conn->type = t;
|
||||||
conn->pcb.tcp = NULL;
|
conn->pcb.tcp = NULL;
|
||||||
@ -505,7 +505,7 @@ netconn_bind(struct netconn *conn, struct ip_addr *addr, u16_t port)
|
|||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.function = do_bind;
|
msg.function = do_bind;
|
||||||
msg.msg.conn = conn;
|
msg.msg.conn = conn;
|
||||||
msg.msg.msg.bc.ipaddr = addr;
|
msg.msg.msg.bc.ipaddr = addr;
|
||||||
@ -526,7 +526,7 @@ err_t
|
|||||||
netconn_connect(struct netconn *conn, struct ip_addr *addr, u16_t port)
|
netconn_connect(struct netconn *conn, struct ip_addr *addr, u16_t port)
|
||||||
{
|
{
|
||||||
struct api_msg msg;
|
struct api_msg msg;
|
||||||
|
|
||||||
LWIP_ERROR("netconn_connect: invalid conn", (conn != NULL), return ERR_ARG;);
|
LWIP_ERROR("netconn_connect: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||||
|
|
||||||
if (conn->recvmbox == SYS_MBOX_NULL) {
|
if (conn->recvmbox == SYS_MBOX_NULL) {
|
||||||
@ -534,7 +534,7 @@ netconn_connect(struct netconn *conn, struct ip_addr *addr, u16_t port)
|
|||||||
return ERR_MEM;
|
return ERR_MEM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.function = do_connect;
|
msg.function = do_connect;
|
||||||
msg.msg.conn = conn;
|
msg.msg.conn = conn;
|
||||||
msg.msg.msg.bc.ipaddr = addr;
|
msg.msg.msg.bc.ipaddr = addr;
|
||||||
@ -554,7 +554,7 @@ err_t
|
|||||||
netconn_disconnect(struct netconn *conn)
|
netconn_disconnect(struct netconn *conn)
|
||||||
{
|
{
|
||||||
struct api_msg msg;
|
struct api_msg msg;
|
||||||
|
|
||||||
LWIP_ERROR("netconn_disconnect: invalid conn", (conn != NULL), return ERR_ARG;);
|
LWIP_ERROR("netconn_disconnect: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||||
|
|
||||||
msg.function = do_disconnect;
|
msg.function = do_disconnect;
|
||||||
@ -604,12 +604,12 @@ netconn_accept(struct netconn *conn)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
sys_arch_mbox_fetch(conn->acceptmbox, (void *)&newconn, 0);
|
sys_arch_mbox_fetch(conn->acceptmbox, (void *)&newconn, 0);
|
||||||
#endif /* LWIP_SO_RCVTIMEO*/
|
#endif /* LWIP_SO_RCVTIMEO*/
|
||||||
|
|
||||||
/* Register event with callback */
|
/* Register event with callback */
|
||||||
if (conn->callback)
|
if (conn->callback)
|
||||||
(*conn->callback)(conn, NETCONN_EVT_RCVMINUS, 0);
|
(*conn->callback)(conn, NETCONN_EVT_RCVMINUS, 0);
|
||||||
|
|
||||||
return newconn;
|
return newconn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,7 +626,7 @@ netconn_recv(struct netconn *conn)
|
|||||||
struct netbuf *buf = NULL;
|
struct netbuf *buf = NULL;
|
||||||
struct pbuf *p;
|
struct pbuf *p;
|
||||||
u16_t len;
|
u16_t len;
|
||||||
|
|
||||||
LWIP_ERROR("netconn_recv: invalid conn", (conn != NULL), return NULL;);
|
LWIP_ERROR("netconn_recv: invalid conn", (conn != NULL), return NULL;);
|
||||||
|
|
||||||
if (conn->recvmbox == SYS_MBOX_NULL) {
|
if (conn->recvmbox == SYS_MBOX_NULL) {
|
||||||
@ -653,7 +653,7 @@ netconn_recv(struct netconn *conn)
|
|||||||
conn->err = ERR_MEM;
|
conn->err = ERR_MEM;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LWIP_SO_RCVTIMEO
|
#if LWIP_SO_RCVTIMEO
|
||||||
if (sys_arch_mbox_fetch(conn->recvmbox, (void *)&p, conn->recv_timeout)==SYS_ARCH_TIMEOUT) {
|
if (sys_arch_mbox_fetch(conn->recvmbox, (void *)&p, conn->recv_timeout)==SYS_ARCH_TIMEOUT) {
|
||||||
p = NULL;
|
p = NULL;
|
||||||
@ -668,7 +668,7 @@ netconn_recv(struct netconn *conn)
|
|||||||
} else {
|
} else {
|
||||||
len = 0;
|
len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Register event with callback */
|
/* Register event with callback */
|
||||||
if (conn->callback)
|
if (conn->callback)
|
||||||
(*conn->callback)(conn, NETCONN_EVT_RCVMINUS, len);
|
(*conn->callback)(conn, NETCONN_EVT_RCVMINUS, len);
|
||||||
@ -737,7 +737,7 @@ netconn_sendto(struct netconn *conn, struct netbuf *buf, struct ip_addr *addr, u
|
|||||||
return netconn_send(conn, buf);
|
return netconn_send(conn, buf);
|
||||||
}
|
}
|
||||||
return ERR_VAL;
|
return ERR_VAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send data over a UDP or RAW netconn (that is already connected).
|
* Send data over a UDP or RAW netconn (that is already connected).
|
||||||
@ -812,7 +812,6 @@ netconn_close(struct netconn *conn)
|
|||||||
|
|
||||||
LWIP_ERROR("netconn_close: invalid conn", (conn != NULL), return ERR_ARG;);
|
LWIP_ERROR("netconn_close: invalid conn", (conn != NULL), return ERR_ARG;);
|
||||||
|
|
||||||
|
|
||||||
conn->state = NETCONN_CLOSE;
|
conn->state = NETCONN_CLOSE;
|
||||||
again:
|
again:
|
||||||
msg.function = do_close;
|
msg.function = do_close;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user