diff mbox series

[OpenWrt-Devel] uhttpd: fix building without TLS and Lua support

Message ID 20180926175314.6902-1-paulw@spacemonkey.com
State Accepted
Delegated to: John Crispin
Headers show
Series [OpenWrt-Devel] uhttpd: fix building without TLS and Lua support | expand

Commit Message

Paul Willoughby Sept. 26, 2018, 5:53 p.m. UTC
Adds ifdefs to fix building without TLS and Lua support

Signed-off-by: Paul Willoughby <paulw@spacemonkey.com>
---
 client.c | 2 ++
 main.c   | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/client.c b/client.c
index 3c1aa9d..5913553 100644
--- a/client.c
+++ b/client.c
@@ -557,11 +557,13 @@  void uh_client_notify_state(struct client *cl)
 		if (!s->eof || s->w.data_bytes)
 			return;
 
+#ifdef HAVE_TLS
 		if (cl->tls && cl->ssl.conn && cl->ssl.conn->w.data_bytes) {
 			cl->ssl.conn->eof = s->eof;
 			if (!ustream_write_pending(cl->ssl.conn))
 				return;
 		}
+#endif
 	}
 
 	return client_close(cl);
diff --git a/main.c b/main.c
index 219e37e..0b74231 100644
--- a/main.c
+++ b/main.c
@@ -219,6 +219,7 @@  static void fixup_prefix(char *str)
 	str[len + 1] = 0;
 }
 
+#ifdef HAVE_LUA
 static void add_lua_prefix(const char *prefix, const char *handler) {
 	struct lua_prefix *p;
 	char *pprefix, *phandler;
@@ -235,6 +236,7 @@  static void add_lua_prefix(const char *prefix, const char *handler) {
 
 	list_add_tail(&p->list, &conf.lua_prefix);
 }
+#endif
 
 int main(int argc, char **argv)
 {