From 8d5351a0c43a91d01ee802fd4e0f3c57f1c405e9 Mon Sep 17 00:00:00 2001
From: Andy Green <andy.green@linaro.org>
Date: Wed, 27 Jan 2016 08:50:31 +0800
Subject: [PATCH] reduce debug logging mark socket dead when pollert

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 lib/output.c  | 6 +++---
 lib/service.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/output.c b/lib/output.c
index 5f54a4fa..cfb7c958 100644
--- a/lib/output.c
+++ b/lib/output.c
@@ -131,8 +131,8 @@ int lws_issue_raw(struct lws *wsi, unsigned char *buf, size_t len)
 
 	switch (n) {
 	case LWS_SSL_CAPABLE_ERROR:
-		lwsl_err("%s: wsi %p: LWS_SSL_CAPABLE_ERROR\n", __func__,
-			 (void *)wsi);
+//		lwsl_err("%s: wsi %p: LWS_SSL_CAPABLE_ERROR\n", __func__,
+//			 (void *)wsi);
 		/* we're going to close, let close know sends aren't possible */
 		wsi->socket_is_permanently_unusable = 1;
 		return -1;
@@ -643,7 +643,7 @@ lws_ssl_capable_write_no_ssl(struct lws *wsi, unsigned char *buf, int len)
 
 #if LWS_POSIX
 	n = send(wsi->sock, (char *)buf, len, MSG_NOSIGNAL);
-	lwsl_info("%s: sent len %d result %d", __func__, len, n);
+//	lwsl_info("%s: sent len %d result %d", __func__, len, n);
 	if (n >= 0)
 		return n;
 
diff --git a/lib/service.c b/lib/service.c
index ef930551..89fe32c0 100644
--- a/lib/service.c
+++ b/lib/service.c
@@ -436,7 +436,7 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, int t
 			}
 			wsi = wsi1;
 		}
-#if 1
+#if 0
 		{
 			char s[300], *p = s;
 
@@ -475,7 +475,7 @@ lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, int t
 
 	if ((!(pollfd->revents & pollfd->events & LWS_POLLIN)) &&
 	    (pollfd->revents & LWS_POLLHUP)) {
-
+		wsi->socket_is_permanently_unusable = 1;
 		lwsl_debug("Session Socket %p (fd=%d) dead\n",
 						       (void *)wsi, pollfd->fd);
 
-- 
GitLab