From 822241c2a79d05c535dc2c7415fd8345ee72b7fb Mon Sep 17 00:00:00 2001
From: Andy Green <andy.green@linaro.org>
Date: Mon, 18 Aug 2014 22:21:51 +0800
Subject: [PATCH] deprecate no_buffer_all_partials

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 changelog           | 10 ++++++++++
 lib/libwebsockets.h |  9 ---------
 lib/output.c        |  3 +--
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/changelog b/changelog
index 8e592251..95e61940 100644
--- a/changelog
+++ b/changelog
@@ -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
 =======================
 
diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h
index 3cd5b597..a0c500ac 100644
--- a/lib/libwebsockets.h
+++ b/lib/libwebsockets.h
@@ -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;
 
 	/*
diff --git a/lib/output.c b/lib/output.c
index 28e15a6d..cd8da351 100644
--- a/lib/output.c
+++ b/lib/output.c
@@ -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
-- 
GitLab