deprecate no_buffer_all_partials

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2014-08-18 22:21:51 +08:00
parent 66d466a1a4
commit 822241c2a7
3 changed files with 11 additions and 11 deletions

View file

@ -22,6 +22,16 @@ ssl and non-ssl connections are possible and may need to be treated differently
in the user code.
User api removal
----------------
protocols struct member no_buffer_all_partial_tx is removed. Under some
conditions like rewriting extention such as compression in use, the built-in
partial send buffering is the only way to deal with the problem, so turning
it off is deprecated.
v1.3-chrome37-firefox30
=======================

View file

@ -858,14 +858,6 @@ typedef int (extension_callback_function)(struct libwebsocket_context *context,
* libwebsockets_remaining_packet_payload(). Notice that you
* just talk about frame size here, the LWS_SEND_BUFFER_PRE_PADDING
* and post-padding are automatically also allocated on top.
* @no_buffer_all_partial_tx: Leave at zero if you want the library to take
* care of all partial tx for you. It's useful if you only have
* small tx packets and the chance of any truncated send is small
* enough any additional malloc / buffering overhead is less
* painful than writing the code to deal with partial sends. For
* protocols where you stream big blocks, set to nonzero and use
* the return value from libwebsocket_write() to manage how much
* got send yourself.
* @id: ignored by lws, but useful to contain user information bound
* to the selected protocol. For example if this protocol was
* called "myprotocol-v2", you might set id to 2, and the user
@ -890,7 +882,6 @@ struct libwebsocket_protocols {
callback_function *callback;
size_t per_session_data_size;
size_t rx_buffer_size;
int no_buffer_all_partial_tx;
unsigned int id;
/*

View file

@ -275,8 +275,7 @@ LWS_VISIBLE int libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf,
if (wsi->u.ws.inside_frame)
goto do_more_inside_frame;
/* if he wants all partials buffered, never have a clean_buffer */
wsi->u.ws.clean_buffer = !wsi->protocol->no_buffer_all_partial_tx;
wsi->u.ws.clean_buffer = 1;
/*
* give a chance to the extensions to modify payload