From 34c336c1f3ad98918bb044533a43985413d05734 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 9 Sep 2014 09:30:02 -0400 Subject: [PATCH] Work around deprecation of SoupServer's port property See https://bugzilla.gnome.org/show_bug.cgi?id=732184 --- Makefile.am | 2 +- src/ostree/ot-builtin-trivial-httpd.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 614413ca..34381ec3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,7 +23,7 @@ AM_CPPFLAGS += -DDATADIR='"$(datadir)"' -DLIBEXECDIR='"$(libexecdir)"' \ -DGPGVPATH=\"$(GPGVPATH)\" \ -DOSTREE_FEATURES='"$(OSTREE_FEATURES)"' \ -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_36 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_36 \ - -DSOUP_VERSION_MIN_REQUIRED=SOUP_VERSION_2_40 -DSOUP_VERSION_MAX_ALLOWED=SOUP_VERSION_40 + -DSOUP_VERSION_MIN_REQUIRED=SOUP_VERSION_2_40 -DSOUP_VERSION_MAX_ALLOWED=SOUP_VERSION_2_48 AM_CFLAGS += $(WARN_CFLAGS) DISTCHECK_CONFIGURE_FLAGS += --enable-gtk-doc --disable-maintainer-mode diff --git a/src/ostree/ot-builtin-trivial-httpd.c b/src/ostree/ot-builtin-trivial-httpd.c index 4cfc4b47..727ff30f 100644 --- a/src/ostree/ot-builtin-trivial-httpd.c +++ b/src/ostree/ot-builtin-trivial-httpd.c @@ -345,9 +345,15 @@ ostree_builtin_trivial_httpd (int argc, char **argv, OstreeRepo *repo, GCancella app->root = g_file_new_for_path (dirpath); +#if SOUP_CHECK_VERSION(2, 48, 0) + server = soup_server_new (SOUP_SERVER_SERVER_HEADER, "ostree-httpd ", NULL); + soup_server_listen (server, NULL, 0); +#else server = soup_server_new (SOUP_SERVER_PORT, 0, SOUP_SERVER_SERVER_HEADER, "ostree-httpd ", NULL); +#endif + soup_server_add_handler (server, NULL, httpd_callback, app, NULL); if (opt_port_file) {