1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

service: stop trying to find service TID after first time

This commit is contained in:
Andy Green 2017-11-05 07:10:41 +08:00
parent 9d654abedf
commit bc6f8179c6
4 changed files with 10 additions and 6 deletions

View file

@ -151,8 +151,9 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
context->service_tid_detected =
context->vhost_list->protocols[0].callback(
&_lws, LWS_CALLBACK_GET_THREAD_ID, NULL, NULL, 0);
context->service_tid = context->service_tid_detected;
context->service_tid_detected = 1;
}
context->service_tid = context->service_tid_detected;
/*
* is there anybody with pending stuff that needs service forcing?

View file

@ -111,8 +111,9 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
context->service_tid_detected =
context->vhost_list->protocols[0].callback(
&_lws, LWS_CALLBACK_GET_THREAD_ID, NULL, NULL, 0);
context->service_tid = context->service_tid_detected;
context->service_tid_detected = 1;
}
context->service_tid = context->service_tid_detected;
/*
* is there anybody with pending stuff that needs service forcing?

View file

@ -153,8 +153,9 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
context->service_tid_detected =
context->vhost_list->protocols[0].callback(
&_lws, LWS_CALLBACK_GET_THREAD_ID, NULL, NULL, 0);
context->service_tid = context->service_tid_detected;
context->service_tid_detected = 1;
}
context->service_tid = context->service_tid_detected;
/*
* is there anybody with pending stuff that needs service forcing?
@ -171,8 +172,8 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
n = poll(pt->fds, pt->fds_count, timeout_ms);
#ifdef LWS_OPENSSL_SUPPORT
if (!pt->rx_draining_ext_list &&
!lws_ssl_anybody_has_buffered_read_tsi(context, tsi) && !n) {
if (!n && !pt->rx_draining_ext_list &&
!lws_ssl_anybody_has_buffered_read_tsi(context, tsi)) {
#else
if (!pt->rx_draining_ext_list && !n) /* poll timeout */ {
#endif

View file

@ -178,8 +178,9 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
context->service_tid_detected = context->vhost_list->
protocols[0].callback(&_lws, LWS_CALLBACK_GET_THREAD_ID,
NULL, NULL, 0);
context->service_tid = context->service_tid_detected;
context->service_tid_detected = 1;
}
context->service_tid = context->service_tid_detected;
if (timeout_ms < 0)
{