diff --git a/lib/client-handshake.c b/lib/client-handshake.c index cfb1f39c..882b6198 100644 --- a/lib/client-handshake.c +++ b/lib/client-handshake.c @@ -477,7 +477,7 @@ lws_client_reset(struct lws **pwsi, int ssl, const char *address, int port, if (p) strncpy(method, p, sizeof(iface) - 1); - lwsl_notice("redirect ads='%s', port=%d, path='%s', ssl = %d\n", + lwsl_info("redirect ads='%s', port=%d, path='%s', ssl = %d\n", address, port, path, ssl); /* close the connection by hand */ diff --git a/lib/parsers.c b/lib/parsers.c index 2f4799e9..b944c236 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -299,7 +299,7 @@ int lws_header_table_detach(struct lws *wsi, int autoservice) * we're detaching the ah, but it was held an * unreasonably long time */ - lwsl_notice("%s: wsi %p: ah held %ds, " + lwsl_info("%s: wsi %p: ah held %ds, " "ah.rxpos %d, ah.rxlen %d, mode/state %d %d," "wsi->more_rx_waiting %d\n", __func__, wsi, (int)(now - ah->assigned), diff --git a/lib/server.c b/lib/server.c index 25fa81c4..b323951b 100644 --- a/lib/server.c +++ b/lib/server.c @@ -1039,10 +1039,7 @@ lws_http_action(struct lws *wsi) lws_hdr_simple_ptr(wsi, WSI_TOKEN_HOST), uri_ptr); - lwsl_notice("%s\n", end); lws_clean_url((char *)end); - lwsl_notice("%s\n", end); - n = lws_http_redirect(wsi, HTTP_STATUS_MOVED_PERMANENTLY, end, n, &p, end); if ((int)n < 0) diff --git a/lib/service.c b/lib/service.c index 320f37c4..1850426a 100644 --- a/lib/service.c +++ b/lib/service.c @@ -469,7 +469,7 @@ lws_service_timeout_check(struct lws *wsi, unsigned int sec) /* no need to log normal idle keepalive timeout */ if (wsi->pending_timeout != PENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE) - lwsl_notice("wsi %p: TIMEDOUT WAITING on %d (did hdr %d, ah %p, wl %d, pfd events %d) %llu vs %llu\n", + lwsl_info("wsi %p: TIMEDOUT WAITING on %d (did hdr %d, ah %p, wl %d, pfd events %d) %llu vs %llu\n", (void *)wsi, wsi->pending_timeout, wsi->hdr_parsing_completed, wsi->u.hdr.ah, pt->ah_wait_list_length, n, (unsigned long long)sec, (unsigned long long)wsi->pending_timeout_limit); diff --git a/lib/ssl.c b/lib/ssl.c index c0f392a2..65efeedc 100644 --- a/lib/ssl.c +++ b/lib/ssl.c @@ -257,7 +257,7 @@ lws_ssl_elaborate_error(void) while ((err = ERR_get_error()) != 0) { ERR_error_string_n(err, buf, sizeof(buf)); - lwsl_err("*** %s\n", buf); + lwsl_info("*** %s\n", buf); } #endif } @@ -455,7 +455,7 @@ lws_ssl_capable_read(struct lws *wsi, unsigned char *buf, int len) #endif } - lwsl_err("%s failed: %s\n",__func__, + lwsl_info("%s failed: %s\n",__func__, ERR_error_string(lws_ssl_get_error(wsi, 0), NULL)); lws_ssl_elaborate_error(); @@ -477,7 +477,7 @@ lws_ssl_capable_read(struct lws *wsi, unsigned char *buf, int len) } - lwsl_err("%s failed2: %s\n",__func__, + lwsl_info("%s failed2: %s\n",__func__, ERR_error_string(lws_ssl_get_error(wsi, 0), NULL)); lws_ssl_elaborate_error(); @@ -561,23 +561,22 @@ lws_ssl_capable_write(struct lws *wsi, unsigned char *buf, int len) return LWS_SSL_CAPABLE_MORE_SERVICE; } - if (n == SSL_ERROR_ZERO_RETURN) - return LWS_SSL_CAPABLE_ERROR; + if (n == SSL_ERROR_ZERO_RETURN) + return LWS_SSL_CAPABLE_ERROR; #if !defined(LWS_USE_MBEDTLS) - if (n == SSL_ERROR_SYSCALL) { + if (n == SSL_ERROR_SYSCALL) { + int err = ERR_get_error(); - int err = ERR_get_error(); - if (err == 0 - && (ssl_read_errno == EPIPE - || ssl_read_errno == ECONNABORTED - || ssl_read_errno == 0)) - return LWS_SSL_CAPABLE_ERROR; - } + if (err == 0 && (ssl_read_errno == EPIPE || + ssl_read_errno == ECONNABORTED || + ssl_read_errno == 0)) + return LWS_SSL_CAPABLE_ERROR; + } #endif - lwsl_err("%s failed: %s\n",__func__, - ERR_error_string(lws_ssl_get_error(wsi, 0), NULL)); + lwsl_info("%s failed: %s\n",__func__, + ERR_error_string(lws_ssl_get_error(wsi, 0), NULL)); lws_ssl_elaborate_error(); return LWS_SSL_CAPABLE_ERROR; @@ -596,8 +595,9 @@ lws_gate_accepts(struct lws_context *context, int on) while (v) { if (v->use_ssl && v->lserv_wsi) /* gate ability to accept incoming connections */ - if (lws_change_pollfd(v->lserv_wsi, (LWS_POLLIN) * !on, (LWS_POLLIN) * on)) - lwsl_err("Unable to set accept POLLIN %d\n", on); + if (lws_change_pollfd(v->lserv_wsi, (LWS_POLLIN) * !on, + (LWS_POLLIN) * on)) + lwsl_info("Unable to set accept POLLIN %d\n", on); v = v->vhost_next; } @@ -681,6 +681,8 @@ lws_server_socket_service_ssl(struct lws *wsi, lws_sockfd_type accept_fd) #endif char buf[256]; + (void)buf; + if (!LWS_SSL_ENABLED(wsi->vhost)) return 0; @@ -857,7 +859,7 @@ lws_server_socket_service_ssl(struct lws *wsi, lws_sockfd_type accept_fd) go_again: if (m == SSL_ERROR_WANT_READ || SSL_want_read(wsi->ssl)) { if (lws_change_pollfd(wsi, 0, LWS_POLLIN)) { - lwsl_err("%s: WANT_READ change_pollfd failed\n", __func__); + lwsl_info("%s: WANT_READ change_pollfd failed\n", __func__); goto fail; } @@ -868,14 +870,14 @@ go_again: lwsl_debug("%s: WANT_WRITE\n", __func__); if (lws_change_pollfd(wsi, 0, LWS_POLLOUT)) { - lwsl_err("%s: WANT_WRITE change_pollfd failed\n", __func__); + lwsl_info("%s: WANT_WRITE change_pollfd failed\n", __func__); goto fail; } break; } lws_stats_atomic_bump(wsi->context, pt, LWSSTATS_C_SSL_CONNECTIONS_FAILED, 1); - lwsl_err("SSL_accept failed socket %u: %s\n", wsi->desc.sockfd, + lwsl_info("SSL_accept failed socket %u: %s\n", wsi->desc.sockfd, lws_ssl_get_error_string(m, n, buf, sizeof(buf))); lws_ssl_elaborate_error(); goto fail;