mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
dont try figure out listen_service_fd position if unset
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
a47865fa19
commit
f0b79e238c
1 changed files with 6 additions and 1 deletions
|
@ -786,7 +786,7 @@ libwebsocket_service_fd(struct libwebsocket_context *context,
|
||||||
struct libwebsocket *wsi;
|
struct libwebsocket *wsi;
|
||||||
int n;
|
int n;
|
||||||
int m;
|
int m;
|
||||||
int listen_socket_fds_index = context->lws_lookup[context->listen_service_fd]->position_in_fds_table;
|
int listen_socket_fds_index = 0;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
#ifdef LWS_OPENSSL_SUPPORT
|
#ifdef LWS_OPENSSL_SUPPORT
|
||||||
char ssl_err_buf[512];
|
char ssl_err_buf[512];
|
||||||
|
@ -802,6 +802,11 @@ libwebsocket_service_fd(struct libwebsocket_context *context,
|
||||||
#ifndef LWS_NO_SERVER
|
#ifndef LWS_NO_SERVER
|
||||||
extern int lws_server_socket_service(struct libwebsocket_context *context, struct libwebsocket *wsi, struct pollfd *pollfd);
|
extern int lws_server_socket_service(struct libwebsocket_context *context, struct libwebsocket *wsi, struct pollfd *pollfd);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (context->listen_service_fd)
|
||||||
|
listen_socket_fds_index = context->lws_lookup[
|
||||||
|
context->listen_service_fd]->position_in_fds_table;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* you can call us with pollfd = NULL to just allow the once-per-second
|
* you can call us with pollfd = NULL to just allow the once-per-second
|
||||||
* global timeout checks; if less than a second since the last check
|
* global timeout checks; if less than a second since the last check
|
||||||
|
|
Loading…
Add table
Reference in a new issue