summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/tcp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/net/tcp.c b/src/net/tcp.c
index 06c66c954..830e8d50e 100644
--- a/src/net/tcp.c
+++ b/src/net/tcp.c
@@ -277,6 +277,7 @@ static void tcp_close ( struct tcp_connection *tcp, int rc ) {
stop_timer ( &tcp->timer );
list_del ( &tcp->list );
ref_put ( &tcp->refcnt );
+ DBGC ( tcp, "TCP %p connection deleted\n", tcp );
return;
}
@@ -980,6 +981,10 @@ struct socket_opener tcp_socket_opener __socket_opener = {
static int tcp_open_uri ( struct xfer_interface *xfer, struct uri *uri ) {
struct sockaddr_tcpip peer;
+ /* Sanity check */
+ if ( ! uri->host )
+ return -EINVAL;
+
memset ( &peer, 0, sizeof ( peer ) );
peer.st_port = htons ( uri_port ( uri, 0 ) );
return xfer_open_named_socket ( xfer, SOCK_STREAM,