mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-08 23:44:39 +08:00
Minor Fix (unsed code, spaces, idents..)
This commit is contained in:
parent
6bfa99a774
commit
d5e37309e5
@ -89,6 +89,7 @@ recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p,
|
|||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conn->recvmbox != SYS_MBOX_NULL) {
|
if (conn->recvmbox != SYS_MBOX_NULL) {
|
||||||
buf = memp_malloc(MEMP_NETBUF);
|
buf = memp_malloc(MEMP_NETBUF);
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
@ -128,7 +129,6 @@ recv_tcp(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (conn->recvmbox != SYS_MBOX_NULL) {
|
if (conn->recvmbox != SYS_MBOX_NULL) {
|
||||||
|
|
||||||
conn->err = err;
|
conn->err = err;
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
len = p->tot_len;
|
len = p->tot_len;
|
||||||
@ -369,9 +369,7 @@ do_delconn(struct api_msg_msg *msg)
|
|||||||
#endif /* LWIP_RAW */
|
#endif /* LWIP_RAW */
|
||||||
#if LWIP_UDP
|
#if LWIP_UDP
|
||||||
case NETCONN_UDPLITE:
|
case NETCONN_UDPLITE:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDPNOCHKSUM:
|
case NETCONN_UDPNOCHKSUM:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDP:
|
case NETCONN_UDP:
|
||||||
msg->conn->pcb.udp->recv_arg = NULL;
|
msg->conn->pcb.udp->recv_arg = NULL;
|
||||||
udp_remove(msg->conn->pcb.udp);
|
udp_remove(msg->conn->pcb.udp);
|
||||||
@ -425,9 +423,7 @@ do_bind(struct api_msg_msg *msg)
|
|||||||
#endif /* LWIP_RAW */
|
#endif /* LWIP_RAW */
|
||||||
#if LWIP_UDP
|
#if LWIP_UDP
|
||||||
case NETCONN_UDPLITE:
|
case NETCONN_UDPLITE:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDPNOCHKSUM:
|
case NETCONN_UDPNOCHKSUM:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDP:
|
case NETCONN_UDP:
|
||||||
msg->conn->err = udp_bind(msg->conn->pcb.udp, msg->msg.bc.ipaddr, msg->msg.bc.port);
|
msg->conn->err = udp_bind(msg->conn->pcb.udp, msg->msg.bc.ipaddr, msg->msg.bc.port);
|
||||||
break;
|
break;
|
||||||
@ -486,9 +482,7 @@ do_connect(struct api_msg_msg *msg)
|
|||||||
#endif /* LWIP_RAW */
|
#endif /* LWIP_RAW */
|
||||||
#if LWIP_UDP
|
#if LWIP_UDP
|
||||||
case NETCONN_UDPLITE:
|
case NETCONN_UDPLITE:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDPNOCHKSUM:
|
case NETCONN_UDPNOCHKSUM:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDP:
|
case NETCONN_UDP:
|
||||||
udp_connect(msg->conn->pcb.udp, msg->msg.bc.ipaddr, msg->msg.bc.port);
|
udp_connect(msg->conn->pcb.udp, msg->msg.bc.ipaddr, msg->msg.bc.port);
|
||||||
sys_mbox_post(msg->conn->mbox, NULL);
|
sys_mbox_post(msg->conn->mbox, NULL);
|
||||||
@ -511,22 +505,13 @@ void
|
|||||||
do_disconnect(struct api_msg_msg *msg)
|
do_disconnect(struct api_msg_msg *msg)
|
||||||
{
|
{
|
||||||
switch (msg->conn->type) {
|
switch (msg->conn->type) {
|
||||||
#if LWIP_RAW
|
|
||||||
case NETCONN_RAW:
|
|
||||||
/* Do nothing as connecting is only a helper for upper lwip layers */
|
|
||||||
break;
|
|
||||||
#endif /* LWIP_RAW */
|
|
||||||
#if LWIP_UDP
|
#if LWIP_UDP
|
||||||
case NETCONN_UDPLITE:
|
case NETCONN_UDPLITE:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDPNOCHKSUM:
|
case NETCONN_UDPNOCHKSUM:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDP:
|
case NETCONN_UDP:
|
||||||
udp_disconnect(msg->conn->pcb.udp);
|
udp_disconnect(msg->conn->pcb.udp);
|
||||||
break;
|
break;
|
||||||
#endif /* LWIP_UDP */
|
#endif /* LWIP_UDP */
|
||||||
case NETCONN_TCP:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
sys_mbox_post(msg->conn->mbox, NULL);
|
sys_mbox_post(msg->conn->mbox, NULL);
|
||||||
}
|
}
|
||||||
@ -537,20 +522,6 @@ do_listen(struct api_msg_msg *msg)
|
|||||||
{
|
{
|
||||||
if (msg->conn->pcb.tcp != NULL) {
|
if (msg->conn->pcb.tcp != NULL) {
|
||||||
switch (msg->conn->type) {
|
switch (msg->conn->type) {
|
||||||
#if LWIP_RAW
|
|
||||||
case NETCONN_RAW:
|
|
||||||
LWIP_DEBUGF(API_MSG_DEBUG, ("api_msg: listen RAW: cannot listen for RAW.\n"));
|
|
||||||
break;
|
|
||||||
#endif /* LWIP_RAW */
|
|
||||||
#if LWIP_UDP
|
|
||||||
case NETCONN_UDPLITE:
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDPNOCHKSUM:
|
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDP:
|
|
||||||
LWIP_DEBUGF(API_MSG_DEBUG, ("api_msg: listen UDP: cannot listen for UDP.\n"));
|
|
||||||
break;
|
|
||||||
#endif /* LWIP_UDP */
|
|
||||||
#if LWIP_TCP
|
#if LWIP_TCP
|
||||||
case NETCONN_TCP:
|
case NETCONN_TCP:
|
||||||
msg->conn->pcb.tcp = tcp_listen(msg->conn->pcb.tcp);
|
msg->conn->pcb.tcp = tcp_listen(msg->conn->pcb.tcp);
|
||||||
@ -567,8 +538,6 @@ do_listen(struct api_msg_msg *msg)
|
|||||||
tcp_accept(msg->conn->pcb.tcp, accept_function);
|
tcp_accept(msg->conn->pcb.tcp, accept_function);
|
||||||
}
|
}
|
||||||
#endif /* LWIP_TCP */
|
#endif /* LWIP_TCP */
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sys_mbox_post(msg->conn->mbox, NULL);
|
sys_mbox_post(msg->conn->mbox, NULL);
|
||||||
@ -577,7 +546,6 @@ do_listen(struct api_msg_msg *msg)
|
|||||||
void
|
void
|
||||||
do_send(struct api_msg_msg *msg)
|
do_send(struct api_msg_msg *msg)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (msg->conn->err==ERR_OK) {
|
if (msg->conn->err==ERR_OK) {
|
||||||
if (msg->conn->pcb.tcp != NULL) {
|
if (msg->conn->pcb.tcp != NULL) {
|
||||||
switch (msg->conn->type) {
|
switch (msg->conn->type) {
|
||||||
@ -592,9 +560,7 @@ do_send(struct api_msg_msg *msg)
|
|||||||
#endif
|
#endif
|
||||||
#if LWIP_UDP
|
#if LWIP_UDP
|
||||||
case NETCONN_UDPLITE:
|
case NETCONN_UDPLITE:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDPNOCHKSUM:
|
case NETCONN_UDPNOCHKSUM:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDP:
|
case NETCONN_UDP:
|
||||||
if (msg->msg.b->addr==NULL) {
|
if (msg->msg.b->addr==NULL) {
|
||||||
msg->conn->err = udp_send(msg->conn->pcb.udp, msg->msg.b->p);
|
msg->conn->err = udp_send(msg->conn->pcb.udp, msg->msg.b->p);
|
||||||
@ -603,8 +569,6 @@ do_send(struct api_msg_msg *msg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* LWIP_UDP */
|
#endif /* LWIP_UDP */
|
||||||
case NETCONN_TCP:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -620,7 +584,7 @@ do_recv(struct api_msg_msg *msg)
|
|||||||
tcp_recved(msg->conn->pcb.tcp, msg->msg.len);
|
tcp_recved(msg->conn->pcb.tcp, msg->msg.len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* LWIP_TCP */
|
||||||
sys_mbox_post(msg->conn->mbox, NULL);
|
sys_mbox_post(msg->conn->mbox, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -629,7 +593,7 @@ do_write(struct api_msg_msg *msg)
|
|||||||
{
|
{
|
||||||
#if LWIP_TCP
|
#if LWIP_TCP
|
||||||
err_t err;
|
err_t err;
|
||||||
#endif
|
#endif /* LWIP_TCP */
|
||||||
if (msg->conn->err==ERR_OK) {
|
if (msg->conn->err==ERR_OK) {
|
||||||
if (msg->conn->pcb.tcp != NULL) {
|
if (msg->conn->pcb.tcp != NULL) {
|
||||||
switch (msg->conn->type) {
|
switch (msg->conn->type) {
|
||||||
@ -640,9 +604,7 @@ do_write(struct api_msg_msg *msg)
|
|||||||
#endif
|
#endif
|
||||||
#if LWIP_UDP
|
#if LWIP_UDP
|
||||||
case NETCONN_UDPLITE:
|
case NETCONN_UDPLITE:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDPNOCHKSUM:
|
case NETCONN_UDPNOCHKSUM:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDP:
|
case NETCONN_UDP:
|
||||||
msg->conn->err = ERR_VAL;
|
msg->conn->err = ERR_VAL;
|
||||||
break;
|
break;
|
||||||
@ -667,8 +629,7 @@ do_write(struct api_msg_msg *msg)
|
|||||||
(*msg->conn->callback)(msg->conn, NETCONN_EVT_SENDMINUS, msg->msg.w.len);
|
(*msg->conn->callback)(msg->conn, NETCONN_EVT_SENDMINUS, msg->msg.w.len);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -690,9 +651,7 @@ do_close(struct api_msg_msg *msg)
|
|||||||
#endif
|
#endif
|
||||||
#if LWIP_UDP
|
#if LWIP_UDP
|
||||||
case NETCONN_UDPLITE:
|
case NETCONN_UDPLITE:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDPNOCHKSUM:
|
case NETCONN_UDPNOCHKSUM:
|
||||||
/* FALLTHROUGH */
|
|
||||||
case NETCONN_UDP:
|
case NETCONN_UDP:
|
||||||
break;
|
break;
|
||||||
#endif /* LWIP_UDP */
|
#endif /* LWIP_UDP */
|
||||||
@ -705,8 +664,6 @@ do_close(struct api_msg_msg *msg)
|
|||||||
}
|
}
|
||||||
msg->conn->err = err;
|
msg->conn->err = err;
|
||||||
#endif
|
#endif
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sys_mbox_post(msg->conn->mbox, NULL);
|
sys_mbox_post(msg->conn->mbox, NULL);
|
||||||
@ -721,10 +678,6 @@ do_join_leave_group(struct api_msg_msg *msg)
|
|||||||
if (msg->conn->err==ERR_OK) {
|
if (msg->conn->err==ERR_OK) {
|
||||||
if (msg->conn->pcb.tcp != NULL) {
|
if (msg->conn->pcb.tcp != NULL) {
|
||||||
switch (msg->conn->type) {
|
switch (msg->conn->type) {
|
||||||
#if LWIP_RAW
|
|
||||||
case NETCONN_RAW:
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#if LWIP_UDP
|
#if LWIP_UDP
|
||||||
case NETCONN_UDPLITE:
|
case NETCONN_UDPLITE:
|
||||||
case NETCONN_UDPNOCHKSUM:
|
case NETCONN_UDPNOCHKSUM:
|
||||||
@ -735,12 +688,7 @@ do_join_leave_group(struct api_msg_msg *msg)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* LWIP_UDP */
|
#endif /* LWIP_UDP */
|
||||||
#if LWIP_TCP
|
|
||||||
case NETCONN_TCP:
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
msg->conn->err = err;
|
msg->conn->err = err;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user