summaryrefslogtreecommitdiff
path: root/nuttx/net/connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/net/connect.c')
-rw-r--r--nuttx/net/connect.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/nuttx/net/connect.c b/nuttx/net/connect.c
index 7f3d17609..47047b3cf 100644
--- a/nuttx/net/connect.c
+++ b/nuttx/net/connect.c
@@ -100,8 +100,11 @@ static inline int tcp_connect(FAR struct socket *psock, const struct sockaddr_in
static void connection_event(void *private)
{
FAR struct socket *psock = (FAR struct socket *)private;
+
if (psock)
{
+ vdbg("uip_flags: %02x s_flags: %02x\n", uip_flags, psock->s_flags);
+
/* UIP_CLOSE: The remote host has closed the connection
* UIP_ABORT: The remote host has aborted the connection
* UIP_TIMEDOUT: Connection aborted due to too many retransmissions.
@@ -189,7 +192,7 @@ static void tcp_connect_interrupt(struct uip_driver_s *dev, void *private)
{
struct tcp_connect_s *pstate = (struct tcp_connect_s *)private;
- vdbg("Interrupt uip_flags=%02x\n", uip_flags);
+ vdbg("uip_flags: %02x\n", uip_flags);
/* 'private' might be null in some race conditions (?) */
@@ -214,7 +217,6 @@ static void tcp_connect_interrupt(struct uip_driver_s *dev, void *private)
{
/* Indicate that remote host refused the connection */
- vdbg("ECONNREFUSED\n");
pstate->tc_result = -ECONNREFUSED;
}
@@ -224,7 +226,6 @@ static void tcp_connect_interrupt(struct uip_driver_s *dev, void *private)
{
/* Indicate that the remote host is unreachable (or should this be timedout?) */
- vdbg("ETIMEDOUT\n");
pstate->tc_result = -ETIMEDOUT;
}
@@ -234,7 +235,6 @@ static void tcp_connect_interrupt(struct uip_driver_s *dev, void *private)
{
/* Indicate that the socket is no longer connected */
- vdbg("Connected\n");
pstate->tc_result = OK;
}
@@ -245,6 +245,8 @@ static void tcp_connect_interrupt(struct uip_driver_s *dev, void *private)
return;
}
+ vdbg("Resuming: %d\n", pstate->tc_result);
+
/* Stop further callbacks */
tcp_teardown_callbacks(pstate->tc_conn, pstate->tc_result);
@@ -469,8 +471,6 @@ int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
{
case SOCK_STREAM:
{
- dbg("TCP\n");
-
/* Verify that the socket is not already connected */
if (_SS_ISCONNECTED(psock->s_flags))
@@ -493,8 +493,6 @@ int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
#ifdef CONFIG_NET_UDP
case SOCK_DGRAM:
{
- dbg("UDP\n");
-
ret = uip_udpconnect(psock->s_conn, inaddr);
if (ret < 0)
{