summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan-Simon Moeller <jsmoeller@linuxfoundation.org>2016-09-01 15:44:18 +0000
committerGerrit Code Review <gerrit@172.30.200.200>2016-09-01 15:44:18 +0000
commit86692ea51c6f3f4c0e4d63bf4db3ef76fb0221bd (patch)
treea6782c956385d916e9ba7cfed5ceaff76d3e0b33
parent1efc7cbb5ed4de2092d63af7e48c4a78e48d428f (diff)
parent8303ea3a3893692638bdf772844a4b272b93fe89 (diff)
Merge "Improves the handling of upgrade for websockets"
-rw-r--r--meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd/allows-upgrade.patch91
-rw-r--r--meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bb (renamed from meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.48.bb)12
-rw-r--r--meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bbappend (renamed from meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.48.bbappend)0
3 files changed, 84 insertions, 19 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
index b35d970..19601a5 100644
--- a/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd/allows-upgrade.patch
+++ b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd/allows-upgrade.patch
@@ -1,14 +1,81 @@
diff -Naur a/src/microhttpd/connection.c b/src/microhttpd/connection.c
---- a/src/microhttpd/connection.c 2016-04-20 11:35:50.259534537 +0000
-+++ b/src/microhttpd/connection.c 2016-04-20 11:29:46.291569583 +0000
-@@ -733,8 +733,7 @@
- {
- if (NULL == end)
- return MHD_YES;
-- if ( (MHD_str_equal_caseless_ (end, "close")) ||
-- (MHD_str_equal_caseless_ (end, "upgrade")) )
+--- 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;
- }
-
++ 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.48.bb b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bb
index 892009e..9abb200 100644
--- a/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.48.bb
+++ b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bb
@@ -6,22 +6,20 @@ SECTION = "net"
DEPENDS = "libgcrypt gnutls file"
SRC_URI = "http://ftp.gnu.org/gnu/libmicrohttpd/${BPN}-${PV}.tar.gz"
-SRC_URI[md5sum] = "9c298c890088a91fe0d7ac3fec9d0097"
-SRC_URI[sha256sum] = "87667e158f2bf8c691a002e256ffe30885d4121a9ee4143af0320c47cdf8a2a4"
+SRC_URI[md5sum] = "3209aa2ac6199b874a6325342b86edbc"
+SRC_URI[sha256sum] = "9407d8252548ab97ace3276e0032f073820073c0599d43baff832902a8dab11c"
-inherit autotools lib_package
+inherit autotools lib_package pkgconfig
-# disable spdy, because it depends on openssl
EXTRA_OECONF += "--disable-static --with-gnutls=${STAGING_LIBDIR}/../"
PACKAGECONFIG ?= "curl"
PACKAGECONFIG_append_class-target = "\
- ${@base_contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
+ ${@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
+ sed -i s:-L${STAGING_LIBDIR}::g libmicrohttpd.pc
}
-
diff --git a/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.48.bbappend b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bbappend
index c26b811..c26b811 100644
--- a/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.48.bbappend
+++ b/meta-app-framework/recipes-support/libmicrohttpd/libmicrohttpd_0.9.49.bbappend
*/ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }