diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index af77b3a8..9c9d2714 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -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 diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index a0c63e1f..f452e3d4 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -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); ///@} diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h index 1985e0b4..54700b7c 100644 --- a/lib/private-libwebsockets.h +++ b/lib/private-libwebsockets.h @@ -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); diff --git a/lib/roles/h2/ops-h2.c b/lib/roles/h2/ops-h2.c index 47bbaff1..51ac1428 100644 --- a/lib/roles/h2/ops-h2.c +++ b/lib/roles/h2/ops-h2.c @@ -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);