add separate server writeable and change naming to match rest of callbacks
Notice that the naming is changed, the notification to a server that it can write to
the client is now called LWS_CALLBACK_SERVER_WRITEABLE, and the notification to a client
that it can write to a server is LWS_CALLBACK_CLIENT_WRITEABLE.
Signed-off-by: Andy Green <andy@warmcat.com>
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c
index 72a3fe5..2ce43fb 100644
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -582,10 +582,12 @@
LWS_CALLBACK_CLEAR_MODE_POLL_FD,
(void *)(long)wsi->sock, NULL, POLLOUT);
- wsi->protocol->callback(context, wsi,
- LWS_CALLBACK_CLIENT_WRITEABLE,
- wsi->user_space,
- NULL, 0);
+ if (wsi->mode == LWS_CONNMODE_WS_CLIENT)
+ n = LWS_CALLBACK_CLIENT_WRITEABLE;
+ else
+ n = LWS_CALLBACK_SERVER_WRITEABLE;
+
+ wsi->protocol->callback(context, wsi, n, wsi->user_space, NULL, 0);
return 0;
}