mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-25 23:52:51 +00:00
Fixed compilation for LWIP_SO_RCVBUF==0
This commit is contained in:
parent
8fbaf0304a
commit
c49a3ab2d6
@ -81,19 +81,17 @@ recv_raw(void *arg, struct raw_pcb *pcb, struct pbuf *p,
|
|||||||
struct pbuf *q;
|
struct pbuf *q;
|
||||||
struct netbuf *buf;
|
struct netbuf *buf;
|
||||||
struct netconn *conn;
|
struct netconn *conn;
|
||||||
#if LWIP_SO_RCVBUF
|
|
||||||
int recv_avail;
|
|
||||||
#endif /* LWIP_SO_RCVBUF */
|
|
||||||
|
|
||||||
LWIP_UNUSED_ARG(addr);
|
LWIP_UNUSED_ARG(addr);
|
||||||
conn = (struct netconn *)arg;
|
conn = (struct netconn *)arg;
|
||||||
|
|
||||||
|
if ((conn != NULL) && sys_mbox_valid(&conn->recvmbox)) {
|
||||||
#if LWIP_SO_RCVBUF
|
#if LWIP_SO_RCVBUF
|
||||||
|
int recv_avail;
|
||||||
SYS_ARCH_GET(conn->recv_avail, recv_avail);
|
SYS_ARCH_GET(conn->recv_avail, recv_avail);
|
||||||
if ((conn != NULL) && sys_mbox_valid(&conn->recvmbox) &&
|
if ((recv_avail + (int)(p->tot_len)) > conn->recv_bufsize) {
|
||||||
((recv_avail + (int)(p->tot_len)) <= conn->recv_bufsize)) {
|
return 0;
|
||||||
#else /* LWIP_SO_RCVBUF */
|
}
|
||||||
if ((conn != NULL) && (conn->recvmbox != SYS_MBOX_NULL)) {
|
|
||||||
#endif /* LWIP_SO_RCVBUF */
|
#endif /* LWIP_SO_RCVBUF */
|
||||||
/* copy the whole packet into new pbufs */
|
/* copy the whole packet into new pbufs */
|
||||||
q = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
|
q = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM);
|
||||||
@ -162,7 +160,7 @@ recv_udp(void *arg, struct udp_pcb *pcb, struct pbuf *p,
|
|||||||
if ((conn == NULL) || !sys_mbox_valid(&conn->recvmbox) ||
|
if ((conn == NULL) || !sys_mbox_valid(&conn->recvmbox) ||
|
||||||
((recv_avail + (int)(p->tot_len)) > conn->recv_bufsize)) {
|
((recv_avail + (int)(p->tot_len)) > conn->recv_bufsize)) {
|
||||||
#else /* LWIP_SO_RCVBUF */
|
#else /* LWIP_SO_RCVBUF */
|
||||||
if ((conn == NULL) || (conn->recvmbox == SYS_MBOX_NULL)) {
|
if ((conn == NULL) || !sys_mbox_valid(&conn->recvmbox)) {
|
||||||
#endif /* LWIP_SO_RCVBUF */
|
#endif /* LWIP_SO_RCVBUF */
|
||||||
pbuf_free(p);
|
pbuf_free(p);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user