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

lws_get_peer_write_allowance: cope with no role callback for it

https://github.com/warmcat/libwebsockets/issues/1339
This commit is contained in:
Andy Green 2018-07-17 18:28:23 +08:00
parent ff2b1eab36
commit 0222cd25b0

View file

@ -2162,6 +2162,8 @@ lws_partial_buffered(struct lws *wsi)
LWS_VISIBLE lws_fileofs_t
lws_get_peer_write_allowance(struct lws *wsi)
{
if (!wsi->role_ops->tx_credit)
return -1;
return wsi->role_ops->tx_credit(wsi);
}