BUG26722: initialise netconn write variables in netconn_alloc

This commit is contained in:
kieranm 2009-06-25 10:17:18 +00:00
parent 776e1926a3
commit 2b87f899ab
2 changed files with 11 additions and 4 deletions

View File

@ -528,6 +528,13 @@ netconn_alloc(enum netconn_type t, netconn_callback callback)
conn->socket = -1; conn->socket = -1;
conn->callback = callback; conn->callback = callback;
conn->recv_avail = 0; conn->recv_avail = 0;
#if LWIP_TCP
conn->write_msg = NULL;
conn->write_offset = 0;
# if LWIP_TCPIP_CORE_LOCKING
conn->write_delayed = 0;
# endif /* LWIP_TCPIP_CORE_LOCKING */
#endif /* LWIP_TCP */
#if LWIP_SO_RCVTIMEO #if LWIP_SO_RCVTIMEO
conn->recv_timeout = 0; conn->recv_timeout = 0;
#endif /* LWIP_SO_RCVTIMEO */ #endif /* LWIP_SO_RCVTIMEO */

View File

@ -138,20 +138,20 @@ struct netconn {
int recv_bufsize; int recv_bufsize;
#endif /* LWIP_SO_RCVBUF */ #endif /* LWIP_SO_RCVBUF */
u16_t recv_avail; u16_t recv_avail;
#if LWIP_TCP
/** TCP: when data passed to netconn_write doesn't fit into the send buffer, /** TCP: when data passed to netconn_write doesn't fit into the send buffer,
this temporarily stores the message. */ this temporarily stores the message. */
struct api_msg_msg *write_msg; struct api_msg_msg *write_msg;
#if LWIP_TCP
/** TCP: when data passed to netconn_write doesn't fit into the send buffer, /** TCP: when data passed to netconn_write doesn't fit into the send buffer,
this temporarily stores how much is already sent. */ this temporarily stores how much is already sent. */
size_t write_offset; size_t write_offset;
#endif /* LWIP_TCP */ # if LWIP_TCPIP_CORE_LOCKING
#if LWIP_TCPIP_CORE_LOCKING
/** TCP: when data passed to netconn_write doesn't fit into the send buffer, /** TCP: when data passed to netconn_write doesn't fit into the send buffer,
this temporarily stores whether to wake up the original application task this temporarily stores whether to wake up the original application task
if data couldn't be sent in the first try. */ if data couldn't be sent in the first try. */
u8_t write_delayed; u8_t write_delayed;
#endif /* LWIP_TCPIP_CORE_LOCKING */ # endif /* LWIP_TCPIP_CORE_LOCKING */
#endif /* LWIP_TCP */
/** A callback function that is informed about events for this netconn */ /** A callback function that is informed about events for this netconn */
netconn_callback callback; netconn_callback callback;
}; };