From 70edd6fb804d8278b76b5c5edb40e9c77798e0d4 Mon Sep 17 00:00:00 2001
From: Andy Green <andy.green@linaro.org>
Date: Tue, 12 Feb 2013 10:15:25 +0800
Subject: [PATCH] api remove hangup_on_client

Signed-off-by: Andy Green <andy.green@linaro.org>
---
 changelog                  |  4 ++++
 lib/libwebsockets.c        | 21 ---------------------
 lib/libwebsockets.h        |  3 ---
 libwebsockets-api-doc.html | 13 -------------
 4 files changed, 4 insertions(+), 37 deletions(-)

diff --git a/changelog b/changelog
index cd789c39..19db24a8 100644
--- a/changelog
+++ b/changelog
@@ -78,6 +78,10 @@ User api removals
  	and have been removed.  There's a new header management scheme that
 	handles them in a much more compact way.
 
+ - libwebsockets_hangup_on_client() is removed.  If you want to close the
+ 	connection you must do so from the user callback and by returning
+	-1 from there.
+
 
 New features
 ------------
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c
index c905d832..6afec96d 100644
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -423,27 +423,6 @@ just_kill_connection:
 	free(wsi);
 }
 
-/**
- * libwebsockets_hangup_on_client() - Server calls to terminate client
- *					connection
- * @context:	libwebsockets context
- * @fd:		Connection socket descriptor
- */
-
-void
-libwebsockets_hangup_on_client(struct libwebsocket_context *context, int fd)
-{
-	struct libwebsocket *wsi = context->lws_lookup[fd];
-
-	if (wsi) {
-		lwsl_info("close connection at hangup_on_client:\n");
-		libwebsocket_close_and_free_session(context,
-			wsi, LWS_CLOSE_STATUS_NOSTATUS);
-	} else
-		close(fd);
-}
-
-
 /**
  * libwebsockets_get_peer_addresses() - Get client address information
  * @context:	Libwebsockets context
diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h
index 3a37b4fe..db95fe88 100644
--- a/lib/libwebsockets.h
+++ b/lib/libwebsockets.h
@@ -917,9 +917,6 @@ libwebsockets_get_peer_addresses(struct libwebsocket_context *context,
 		struct libwebsocket *wsi, int fd, char *name, int name_len,
 					char *rip, int rip_len);
 
-LWS_EXTERN void
-libwebsockets_hangup_on_client(struct libwebsocket_context *context, int fd);
-
 LWS_EXTERN void
 libwebsocket_close_and_free_session(struct libwebsocket_context *context,
 			       struct libwebsocket *wsi, enum lws_close_status);
diff --git a/libwebsockets-api-doc.html b/libwebsockets-api-doc.html
index 5839ac99..17d9e5bc 100644
--- a/libwebsockets-api-doc.html
+++ b/libwebsockets-api-doc.html
@@ -102,19 +102,6 @@ representing the library version followed by the git head hash it
 was built from
 </blockquote>
 <hr>
-<h2>libwebsockets_hangup_on_client - Server calls to terminate client connection</h2>
-<i>void</i>
-<b>libwebsockets_hangup_on_client</b>
-(<i>struct libwebsocket_context *</i> <b>context</b>,
-<i>int</i> <b>fd</b>)
-<h3>Arguments</h3>
-<dl>
-<dt><b>context</b>
-<dd>libwebsockets context
-<dt><b>fd</b>
-<dd>Connection socket descriptor
-</dl>
-<hr>
 <h2>libwebsockets_get_peer_addresses - Get client address information</h2>
 <i>void</i>
 <b>libwebsockets_get_peer_addresses</b>
-- 
GitLab