summaryrefslogtreecommitdiffstats
path: root/meta-app-framework/recipes-support/libmicrohttpd
diff options
context:
space:
mode:
authorStephane Desneux <stephane.desneux@iot.bzh>2017-03-27 16:44:59 +0200
committerStephane Desneux <stephane.desneux@iot.bzh>2017-03-27 16:46:17 +0200
commit7fcf42ba21c2a00a60f32140924fefc3cc39ad28 (patch)
tree49b2eaa11dd2c241dd7fe77b74b7ced1ac1d1d81 /meta-app-framework/recipes-support/libmicrohttpd
parent5875cc45a671b1a3e7671ec84ec6ebb1ab17696a (diff)
parent976e5d5e866d4099e55a50e0fa8d898ea36ad371 (diff)
Merge: migrate appfw from meta-agl-extra
Change-Id: Ic56b86228bb748a54352e79acadf0da1c947be76 Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'meta-app-framework/recipes-support/libmicrohttpd')
-rw-r--r--meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd/allows-upgrade.patch81
-rw-r--r--meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bb25
-rw-r--r--meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bbappend5
3 files changed, 111 insertions, 0 deletions
diff --git a/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd/allows-upgrade.patch b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd/allows-upgrade.patch
new file mode 100644
index 000000000..19601a537
--- /dev/null
+++ b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd/allows-upgrade.patch
@@ -0,0 +1,81 @@
+diff -Naur a/src/microhttpd/connection.c b/src/microhttpd/connection.c
+--- a/src/microhttpd/connection.c 2016-04-08 21:02:26.000000000 +0200
++++ b/src/microhttpd/connection.c 2016-08-29 22:41:53.790560238 +0200
+@@ -708,6 +708,8 @@
+ * "keep-alive", we proceed to use the default for the respective HTTP
+ * version (which is conservative for HTTP 1.0, but might be a bit
+ * optimistic for HTTP 1.1).
++ * In the case of Upgrade, the header Connection should not be set
++ * to keep-alive.
+ *
+ * @param connection the connection to check for keepalive
+ * @return #MHD_YES if (based on the request), a keepalive is
+@@ -750,6 +752,59 @@
+
+
+ /**
++ * Should we try to keep the given connection alive? We can use the
++ * TCP stream for a second request if the connection is HTTP 1.1 and
++ * the "Connection" header either does not exist or is not set to
++ * "close", or if the connection is HTTP 1.0 and the "Connection"
++ * header is explicitly set to "keep-alive". If no HTTP version is
++ * specified (or if it is not 1.0 or 1.1), we definitively close the
++ * connection. If the "Connection" header is not exactly "close" or
++ * "keep-alive", we proceed to use the default for the respective HTTP
++ * version (which is conservative for HTTP 1.0, but might be a bit
++ * optimistic for HTTP 1.1).
++ * In the case of Upgrade, the connection should be kept alive even if
++ * the header Connection is not keep-alive.
++ *
++ * @param connection the connection to check for keepalive
++ * @return #MHD_YES if (based on the request), a keepalive is
++ * legal
++ */
++static int
++should_keepalive (struct MHD_Connection *connection)
++{
++ const char *end;
++
++ if (NULL == connection->version)
++ return MHD_NO;
++ if ( (NULL != connection->response) &&
++ (0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY) ) )
++ return MHD_NO;
++ end = MHD_lookup_connection_value (connection,
++ MHD_HEADER_KIND,
++ MHD_HTTP_HEADER_CONNECTION);
++ if (MHD_str_equal_caseless_(connection->version,
++ MHD_HTTP_VERSION_1_1))
++ {
++ if (NULL == end)
++ return MHD_YES;
++ if ( (MHD_str_equal_caseless_ (end, "close")) )
++ return MHD_NO;
++ return MHD_YES;
++ }
++ if (MHD_str_equal_caseless_(connection->version,
++ MHD_HTTP_VERSION_1_0))
++ {
++ if (NULL == end)
++ return MHD_NO;
++ if (MHD_str_equal_caseless_(end, "Keep-Alive"))
++ return MHD_YES;
++ return MHD_NO;
++ }
++ return MHD_NO;
++}
++
++
++/**
+ * Produce HTTP "Date:" header.
+ *
+ * @param date where to write the header, with
+@@ -2795,7 +2850,7 @@
+ }
+ if (((MHD_YES == connection->read_closed) &&
+ (0 == connection->read_buffer_offset)) ||
+- (MHD_NO == keepalive_possible (connection)))
++ (MHD_NO == should_keepalive (connection)))
+ {
+ /* have to close for some reason */
+ MHD_connection_close_ (connection,
diff --git a/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bb b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bb
new file mode 100644
index 000000000..9abb2004e
--- /dev/null
+++ b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bb
@@ -0,0 +1,25 @@
+DESCRIPTION = "A small C library that is supposed to make it easy to run an HTTP server as part of another application"
+HOMEPAGE = "http://www.gnu.org/software/libmicrohttpd/"
+LICENSE = "LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9331186f4f80db7da0e724bdd6554ee5"
+SECTION = "net"
+DEPENDS = "libgcrypt gnutls file"
+
+SRC_URI = "http://ftp.gnu.org/gnu/libmicrohttpd/${BPN}-${PV}.tar.gz"
+SRC_URI[md5sum] = "3209aa2ac6199b874a6325342b86edbc"
+SRC_URI[sha256sum] = "9407d8252548ab97ace3276e0032f073820073c0599d43baff832902a8dab11c"
+
+inherit autotools lib_package pkgconfig
+
+EXTRA_OECONF += "--disable-static --with-gnutls=${STAGING_LIBDIR}/../"
+
+PACKAGECONFIG ?= "curl"
+PACKAGECONFIG_append_class-target = "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
+"
+PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
+PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl,"
+
+do_compile_append() {
+ sed -i s:-L${STAGING_LIBDIR}::g libmicrohttpd.pc
+}
diff --git a/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bbappend b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bbappend
new file mode 100644
index 000000000..c26b8119f
--- /dev/null
+++ b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bbappend
@@ -0,0 +1,5 @@
+
+FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
+SRC_URI += " file://allows-upgrade.patch"
+
+