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: return lws_fileofs_t

This commit is contained in:
Andy Green 2018-04-26 08:30:12 +08:00
parent 87bb121b47
commit 2e3ddeedb6
4 changed files with 5 additions and 8 deletions

View file

@ -2084,13 +2084,10 @@ lws_partial_buffered(struct lws *wsi)
return !!wsi->trunc_len;
}
LWS_VISIBLE size_t
LWS_VISIBLE lws_fileofs_t
lws_get_peer_write_allowance(struct lws *wsi)
{
if (wsi->role_ops->tx_credit)
return wsi->role_ops->tx_credit(wsi);
return -1;
return wsi->role_ops->tx_credit(wsi);
}
LWS_VISIBLE void

View file

@ -5208,7 +5208,7 @@ lws_get_socket_fd(struct lws *wsi);
* automatically, so this number reflects the situation at the peer or
* intermediary dynamically.
*/
LWS_VISIBLE LWS_EXTERN size_t
LWS_VISIBLE LWS_EXTERN lws_fileofs_t
lws_get_peer_write_allowance(struct lws *wsi);
///@}

View file

@ -550,7 +550,7 @@ struct lws_role_ops {
/* do effective callback on writeable */
int (*callback_on_writable)(struct lws *wsi);
/* connection-specific tx credit in bytes */
lws_filepos_t (*tx_credit)(struct lws *wsi);
lws_fileofs_t (*tx_credit)(struct lws *wsi);
/* role-specific write formatting */
int (*write_role_protocol)(struct lws *wsi, unsigned char *buf,
size_t len, enum lws_write_protocol *wp);

View file

@ -486,7 +486,7 @@ rops_init_context_h2(struct lws_context *context,
return 0;
}
static lws_filepos_t
static lws_fileofs_t
rops_tx_credit_h2(struct lws *wsi)
{
return lws_h2_tx_cr_get(wsi);