gweb: Add more debug prints when error happens
authorJukka Rissanen <jukka.rissanen@linux.intel.com>
Thu, 5 Apr 2012 09:04:07 +0000 (12:04 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Thu, 5 Apr 2012 12:22:53 +0000 (15:22 +0300)
These prints are useful when checking why network
connection failed.

gweb/gweb.c

index 5ec4fb1..3db5dc5 100644 (file)
@@ -1019,6 +1019,7 @@ static int connect_session_transport(struct web_session *session)
        if (session->web->index > 0) {
                if (bind_socket(sk, session->web->index,
                                        session->addr->ai_family) < 0) {
+                       debug(session->web, "bind() %s", strerror(errno));
                        close(sk);
                        return -EIO;
                }
@@ -1033,6 +1034,7 @@ static int connect_session_transport(struct web_session *session)
        }
 
        if (session->transport_channel == NULL) {
+               debug(session->web, "channel missing");
                close(sk);
                return -ENOMEM;
        }
@@ -1049,6 +1051,7 @@ static int connect_session_transport(struct web_session *session)
        if (connect(sk, session->addr->ai_addr,
                        session->addr->ai_addrlen) < 0) {
                if (errno != EINPROGRESS) {
+                       debug(session->web, "connect() %s", strerror(errno));
                        close(sk);
                        return -EIO;
                }