mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
clean: reduce logging and add some conditional debug helpers
This commit is contained in:
parent
c48bebc9ae
commit
ce3b99cd8f
8 changed files with 37 additions and 9 deletions
|
@ -181,7 +181,7 @@ start_ws_handshake:
|
|||
* to notice our state and not resend the preface...
|
||||
*/
|
||||
|
||||
lwsl_notice("%s: LRS_H1C_ISSUE_HANDSHAKE fallthru\n", __func__);
|
||||
lwsl_debug("%s: LRS_H1C_ISSUE_HANDSHAKE fallthru\n", __func__);
|
||||
|
||||
/* fallthru */
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ callback_sspc_client(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
lws_sul_schedule(h->context, 0, &h->sul_retry,
|
||||
lws_sspc_sul_retry_cb, LWS_US_PER_SEC);
|
||||
} else
|
||||
lwsl_notice("%s: no sspc on client proxy link close\n", __func__);
|
||||
lwsl_info("%s: no sspc on client proxy link close\n", __func__);
|
||||
break;
|
||||
|
||||
case LWS_CALLBACK_RAW_RX:
|
||||
|
|
|
@ -117,7 +117,6 @@ ss_fetch_policy_state(void *userobj, void *sh, lws_ss_constate_t state,
|
|||
break;
|
||||
|
||||
case LWSSSCS_DISCONNECTED:
|
||||
lwsl_notice("%s: DISCONNECTED\n", __func__);
|
||||
if (m->partway == 1) {
|
||||
lws_ss_policy_parse_abandon(context);
|
||||
break;
|
||||
|
|
|
@ -316,11 +316,11 @@ lws_tls_client_create_vhost_context(struct lws_vhost *vh,
|
|||
}
|
||||
vh->tls.x509_client_CA = d2i_X509(NULL, buf, (long)len);
|
||||
free(buf);
|
||||
lwsl_notice("Loading client CA for verification %s\n", ca_filepath);
|
||||
lwsl_info("Loading client CA for verification %s\n", ca_filepath);
|
||||
#endif
|
||||
} else {
|
||||
vh->tls.x509_client_CA = d2i_X509(NULL, (uint8_t*)ca_mem, (long)ca_mem_len);
|
||||
lwsl_notice("%s: using mem client CA cert %d\n",
|
||||
lwsl_info("%s: using mem client CA cert %d\n",
|
||||
__func__, ca_mem_len);
|
||||
}
|
||||
|
||||
|
@ -366,7 +366,7 @@ lws_tls_client_create_vhost_context(struct lws_vhost *vh,
|
|||
return 1;
|
||||
}
|
||||
|
||||
lwsl_notice("Loaded client cert %s\n", cert_filepath);
|
||||
lwsl_info("Loaded client cert %s\n", cert_filepath);
|
||||
#endif
|
||||
} else if (cert_mem && cert_mem_len) {
|
||||
/* lwsl_hexdump_notice(cert_mem, cert_mem_len - 1); */
|
||||
|
@ -380,7 +380,7 @@ lws_tls_client_create_vhost_context(struct lws_vhost *vh,
|
|||
lws_tls_err_describe_clear();
|
||||
return 1;
|
||||
}
|
||||
lwsl_notice("%s: using mem client cert %d\n",
|
||||
lwsl_info("%s: using mem client cert %d\n",
|
||||
__func__, cert_mem_len);
|
||||
}
|
||||
|
||||
|
|
|
@ -891,7 +891,7 @@ lws_tls_client_create_vhost_context(struct lws_vhost *vh,
|
|||
lws_tls_err_describe_clear();
|
||||
return 1;
|
||||
}
|
||||
lwsl_notice("Loaded client cert %s\n", cert_filepath);
|
||||
lwsl_info("Loaded client cert %s\n", cert_filepath);
|
||||
|
||||
} else if (cert_mem && cert_mem_len) {
|
||||
lws_filepos_t flen;
|
||||
|
|
|
@ -26,6 +26,11 @@
|
|||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
#if defined(__APPLE__) || defined(__linux__)
|
||||
#include <execinfo.h>
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
||||
static int interrupted, bad = 1, port = 0 /* unix domain socket */;
|
||||
static const char *ibind = NULL; /* default to unix domain skt "proxy.ss.lws" */
|
||||
static lws_state_notify_link_t nl;
|
||||
|
@ -234,6 +239,26 @@ sigint_handler(int sig)
|
|||
interrupted = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
assert_bt(int sig)
|
||||
{
|
||||
#if defined(__APPLE__) || defined(__linux__)
|
||||
void *array[20];
|
||||
char **strings;
|
||||
int size, i;
|
||||
|
||||
size = backtrace (array, 10);
|
||||
strings = backtrace_symbols (array, size);
|
||||
if (!strings)
|
||||
return;
|
||||
|
||||
for (i = 0; i < size; i++)
|
||||
printf("%s\n", strings[i]);
|
||||
|
||||
free (strings);
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
int n = 0, logs = LLL_USER | LLL_ERR | LLL_WARN | LLL_NOTICE;
|
||||
|
@ -242,6 +267,7 @@ int main(int argc, const char **argv)
|
|||
const char *p;
|
||||
|
||||
signal(SIGINT, sigint_handler);
|
||||
signal(SIGABRT, assert_bt);
|
||||
|
||||
if ((p = lws_cmdline_option(argc, argv, "-d")))
|
||||
logs = atoi(p);
|
||||
|
|
|
@ -143,6 +143,9 @@ myss_state(void *userobj, void *h_src, lws_ss_constate_t state,
|
|||
{
|
||||
myss_t *m = (myss_t *)userobj;
|
||||
|
||||
lwsl_notice("%s: %s: %s (%d), ord 0x%x\n", __func__, lws_ss_tag(m->ss),
|
||||
lws_ss_state_name((int)state), state, (unsigned int)ack);
|
||||
|
||||
if (state == LWSSSCS_DESTROYING) {
|
||||
lws_sul_cancel(&m->sul);
|
||||
return 0;
|
||||
|
|
|
@ -50,7 +50,7 @@ if (requirements)
|
|||
add_test(NAME st_sstfproxy COMMAND
|
||||
${CMAKE_SOURCE_DIR}/scripts/ctest-background.sh
|
||||
sstfproxy $<TARGET_FILE:lws-minimal-secure-streams-proxy>
|
||||
-i ${CTEST_SOCKET_PATH} --ignore-sigterm)
|
||||
-i ${CTEST_SOCKET_PATH} --ignore-sigterm -d1039)
|
||||
set_tests_properties(st_sstfproxy PROPERTIES WORKING_DIRECTORY . FIXTURES_SETUP sstfproxy TIMEOUT 800)
|
||||
|
||||
add_test(NAME ki_ssproxy COMMAND
|
||||
|
|
Loading…
Add table
Reference in a new issue