void *user_space;
struct lws_plat_file_ops fops;
+#ifndef LWS_NO_SERVER
+ struct lws *wsi_listening;
+#endif
};
enum {
_lws_rx_flow_control(struct lws *wsi);
LWS_EXTERN int
lws_handshake_server(struct lws *wsi, unsigned char **buf, size_t len);
+LWS_EXTERN int
+_lws_server_listen_accept_flow_control(struct lws_context *context, int on);
#else
#define lws_server_socket_service(_a, _b, _c) (0)
#define _lws_rx_flow_control(_a) (0)
#define lws_handshake_server(_a, _b, _c) (0)
+#define _lws_server_listen_accept_flow_control(a, b) (0)
#endif
LWS_EXTERN int
wsi->mode = LWSCM_SERVER_LISTENER;
wsi->protocol = context->protocols;
+ context->wsi_listening = wsi;
if (insert_wsi_socket_into_fds(context, wsi))
goto bail;
return 0;
}
+int
+_lws_server_listen_accept_flow_control(struct lws_context *context, int on)
+{
+ struct lws *wsi = context->wsi_listening;
+ int n;
+
+ if (!wsi)
+ return 0;
+
+ if (on)
+ n = lws_change_pollfd(wsi, 0, LWS_POLLIN);
+ else
+ n = lws_change_pollfd(wsi, LWS_POLLIN, 0);
+
+ return n;
+}
+
int lws_http_action(struct lws *wsi)
{
enum http_connection_type connection_type;