LWS_VISIBLE LWS_EXTERN void
lws_stats_log_dump(struct lws_context *context)
{
+ struct lws_vhost *v = context->vhost_list;
+ int n;
+
if (!context->updated)
return;
lwsl_notice(" Avg writable delay: %8lluus\n",
(unsigned long long)(lws_stats_get(context, LWSSTATS_MS_WRITABLE_DELAY) /
lws_stats_get(context, LWSSTATS_C_WRITEABLE_CB)));
+ lwsl_notice("Simultaneous SSL restriction: %8d/%d/%d\n", context->simultaneous_ssl,
+ context->simultaneous_ssl_restriction, context->ssl_gate_accepts);
+
+ lwsl_notice("Live wsi: %8d\n", context->count_wsi_allocated);
+
+#if defined(LWS_WITH_STATS)
+ context->updated = 1;
+#endif
+
+ while (v) {
+ if (v->use_ssl && v->lserv_wsi) {
+ struct lws_context_per_thread *pt = &context->pt[(int)v->lserv_wsi->tsi];
+ struct lws_pollfd *pfd;
+
+ pfd = &pt->fds[v->lserv_wsi->position_in_fds_table];
+
+ lwsl_notice(" Listen port %d actual POLLIN: %d\n",
+ v->listen_port, (int)pfd->events & LWS_POLLIN);
+ }
+
+ v = v->vhost_next;
+ }
+
+ for (n = 0; n < context->count_threads; n++) {
+ struct lws_context_per_thread *pt = &context->pt[n];
+ struct lws *wl;
+ int m = 0;
+
+ lwsl_notice("PT %d\n", n + 1);
+
+ lws_pt_lock(pt);
+
+ lwsl_notice(" AH in use / max: %d / %d\n",
+ pt->ah_count_in_use,
+ context->max_http_header_pool);
+
+ wl = pt->ah_wait_list;
+ while (wl) {
+ m++;
+ wl = wl->u.hdr.ah_wait_list;
+ }
+
+ lwsl_notice(" AH wait list count / actual: %d / %d\n",
+ pt->ah_wait_list_length, m);
+
+ lws_pt_unlock(pt);
+ }
+
lwsl_notice("\n");
}
char slot[8];
nvs_handle nvh;
uint32_t use;
+ int n;
switch(event->event_id) {
case SYSTEM_EVENT_STA_START:
lws_gapss_to(LWS_GAPSS_STAT_HAPPY);
#if !defined(CONFIG_LWS_IS_FACTORY_APPLICATION)
- if (!mdns_init(TCPIP_ADAPTER_IF_STA, &lws_esp32.mdns)) {
+ n = mdns_init(TCPIP_ADAPTER_IF_STA, &lws_esp32.mdns);
+ if (!n) {
static char *txta[4];
mdns_set_hostname(lws_esp32.mdns, lws_esp32.hostname);
(const char **)txta))
lwsl_notice("txt set failed\n");
} else
- lwsl_err("unable to init mdns on STA\n");
+ lwsl_err("unable to init mdns on STA: %d\n", n);
mdns_query(lws_esp32.mdns, "_lwsgrmem", "_tcp", 0);
xTimerStart(mdns_timer, 0);
esp_wifi_set_auto_connect(1);
ESP_ERROR_CHECK( esp_wifi_connect());
- if (mdns_init(TCPIP_ADAPTER_IF_STA, &lws_esp32.mdns))
- lwsl_notice("mdns init failed\n");
+ lws_esp32_scan_timer_cb(NULL);
}
const esp_partition_t *
_lws_change_pollfd(wsi, 0, LWS_POLLIN, &pa);
- lwsl_info("%s: wsi %p: ah %p: count %d (on exit)\n", __func__,
+ lwsl_notice("%s: did attach wsi %p: ah %p: count %d (on exit)\n", __func__,
(void *)wsi, (void *)wsi->u.hdr.ah, pt->ah_count_in_use);
lws_pt_unlock(pt);
unsigned int being_destroyed1:1;
unsigned int requested_kill:1;
unsigned int protocol_init_done:1;
-
+ unsigned int ssl_gate_accepts:1;
/*
* set to the Thread ID that's doing the service loop just before entry
* to poll indicates service thread likely idling in poll()
new_wsi, n, new_wsi->user_space, NULL, 0))
goto fail;
- if (type & LWS_ADOPT_HTTP)
- if (!lws_header_table_attach(new_wsi, 0))
+ if (type & LWS_ADOPT_HTTP) {
+ if (!lws_header_table_attach(new_wsi, 0)) {
lwsl_debug("Attached ah immediately\n");
+ } else {
+ lwsl_notice("%s: waiting for ah\n", __func__);
+ }
+ }
return new_wsi;
struct lws_vhost *v = context->vhost_list;
lwsl_info("gating accepts %d\n", on);
+ context->ssl_gate_accepts = !on;
+#if defined(LWS_WITH_STATS)
+ context->updated = 1;
+#endif
while (v) {
if (v->use_ssl && v->lserv_wsi) /* gate ability to accept incoming connections */
wsi->context->simultaneous_ssl_restriction)
/* we made space and can do an accept */
lws_gate_accepts(wsi->context, 1);
+#if defined(LWS_WITH_STATS)
+ wsi->context->updated = 1;
+#endif
return 1; /* handled */
}
++context->simultaneous_ssl == context->simultaneous_ssl_restriction)
/* that was the last allowed SSL connection */
lws_gate_accepts(context, 0);
+#if defined(LWS_WITH_STATS)
+ context->updated = 1;
+#endif
#if !defined(LWS_WITH_ESP32)
SSL_set_ex_data(wsi->ssl,