[Libreoffice-commits] online.git: 3 commits - loolwsd/configure.ac loolwsd/Connect.cpp loolwsd/FileServer.hpp loolwsd/LOOLWSD.cpp loolwsd/Makefile.am loolwsd/test
Jan Holesovsky
kendy at collabora.com
Tue May 10 09:49:01 UTC 2016
loolwsd/Connect.cpp | 1 +
loolwsd/FileServer.hpp | 4 ++--
loolwsd/LOOLWSD.cpp | 2 +-
loolwsd/Makefile.am | 2 +-
loolwsd/configure.ac | 5 +++--
loolwsd/test/integration-http-server.cpp | 2 +-
6 files changed, 9 insertions(+), 7 deletions(-)
New commits:
commit ea082d6363ee17ba464a35a316392d9ebcf61ef7
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue May 10 11:19:32 2016 +0200
Use git hash for the loleaflet location instead of version.
diff --git a/loolwsd/FileServer.hpp b/loolwsd/FileServer.hpp
index c5f57f9..6c64cd2 100644
--- a/loolwsd/FileServer.hpp
+++ b/loolwsd/FileServer.hpp
@@ -206,7 +206,7 @@ private:
std::string path(requestUri.getPath());
// convert version back to a real file name
- Poco::replaceInPlace(path, std::string("/loleaflet/" LOOLWSD_VERSION "/"), std::string("/loleaflet/dist/"));
+ Poco::replaceInPlace(path, std::string("/loleaflet/" LOOLWSD_VERSION_HASH "/"), std::string("/loleaflet/dist/"));
return path;
}
@@ -228,7 +228,7 @@ private:
Poco::replaceInPlace(preprocess, std::string("%ACCESS_TOKEN%"), form.get("access_token", ""));
Poco::replaceInPlace(preprocess, std::string("%ACCESS_TOKEN_TTL%"), form.get("access_token_ttl", ""));
Poco::replaceInPlace(preprocess, std::string("%HOST%"), host);
- Poco::replaceInPlace(preprocess, std::string("%VERSION%"), std::string(LOOLWSD_VERSION));
+ Poco::replaceInPlace(preprocess, std::string("%VERSION%"), std::string(LOOLWSD_VERSION_HASH));
response.setContentType("text/html");
response.setContentLength(preprocess.length());
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 6cf393f..3151430 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -742,7 +742,7 @@ private:
const std::string urlsrc = "urlsrc";
const std::string uriValue = (LOOLWSD::SSLEnabled ? "https://" : "http://") +
(LOOLWSD::ServerName.empty() ? request.getHost() : LOOLWSD::ServerName) +
- "/loleaflet/" LOOLWSD_VERSION "/loleaflet.html?";
+ "/loleaflet/" LOOLWSD_VERSION_HASH "/loleaflet.html?";
InputSource inputSrc(discoveryPath);
DOMParser parser;
diff --git a/loolwsd/Makefile.am b/loolwsd/Makefile.am
index b69eaab..298909a 100644
--- a/loolwsd/Makefile.am
+++ b/loolwsd/Makefile.am
@@ -136,7 +136,7 @@ run: all @JAILS_PATH@ @SYSTEMPLATE_PATH@/system_stamp
@echo "Launching loolwsd - launch this in your browser:"
@cp $(abs_top_srcdir)/test/data/hello.odt $(abs_top_srcdir)/test/data/hello-world.odt
@PROTOCOL="http" ; if test "z at ENABLE_SSL@" != "z"; then PROTOCOL="https" ; fi ; \
- echo " $$PROTOCOL://localhost:9980/loleaflet/@LOOLWSD_VERSION@/loleaflet.html?file_path=file://$(abs_top_srcdir)/test/data/hello-world.odt"
+ echo " $$PROTOCOL://localhost:9980/loleaflet/@LOOLWSD_VERSION_HASH@/loleaflet.html?file_path=file://$(abs_top_srcdir)/test/data/hello-world.odt"
@echo
./loolwsd --systemplate="@SYSTEMPLATE_PATH@" --lotemplate="@LO_PATH@" \
--childroot="@JAILS_PATH@" --allowlocalstorage --admincreds=admin/admin
diff --git a/loolwsd/configure.ac b/loolwsd/configure.ac
index ebbab30..935316b 100644
--- a/loolwsd/configure.ac
+++ b/loolwsd/configure.ac
@@ -24,10 +24,11 @@ AC_DEFINE_UNQUOTED([LOOLWSD_VERSION],[["$LOOLWSD_VERSION"]],[LibreOffice On-Line
# try to add a git hash for a version if we're developing
LOOLWSD_VERSION_HASH="$LOOLWSD_VERSION"
-git_hash=`cd ${srcdir} && git log -1 --format=%H 2> /dev/null`
+git_hash=`cd ${srcdir} && git log -1 --format=%h 2> /dev/null`
if test "z$git_hash" != "z"; then
LOOLWSD_VERSION_HASH=$git_hash
fi
+AC_SUBST([LOOLWSD_VERSION_HASH])
AC_DEFINE_UNQUOTED([LOOLWSD_VERSION_HASH],[["$LOOLWSD_VERSION_HASH"]],[LibreOffice On-Line git hash if present])
diff --git a/loolwsd/test/integration-http-server.cpp b/loolwsd/test/integration-http-server.cpp
index 598de6d..8cb4f3b 100644
--- a/loolwsd/test/integration-http-server.cpp
+++ b/loolwsd/test/integration-http-server.cpp
@@ -122,7 +122,7 @@ void HTTPServerTest::testLoleafletGet()
CPPUNIT_ASSERT(html.find(param["access_token"]) != std::string::npos);
CPPUNIT_ASSERT(html.find(_uri.getHost()) != std::string::npos);
- CPPUNIT_ASSERT(html.find(std::string(LOOLWSD_VERSION)) != std::string::npos);
+ CPPUNIT_ASSERT(html.find(std::string(LOOLWSD_VERSION_HASH)) != std::string::npos);
}
void HTTPServerTest::testLoleafletPost()
commit fa6d8c85f80484f51475f43972c182aa39777227
Author: Jan Holesovsky <kendy at collabora.com>
Date: Mon May 9 14:43:21 2016 +0200
Correctly produce the git hash, and fallback to version number.
diff --git a/loolwsd/configure.ac b/loolwsd/configure.ac
index 24abbf2..ebbab30 100644
--- a/loolwsd/configure.ac
+++ b/loolwsd/configure.ac
@@ -23,8 +23,8 @@ AC_SUBST([LOOLWSD_VERSION])
AC_DEFINE_UNQUOTED([LOOLWSD_VERSION],[["$LOOLWSD_VERSION"]],[LibreOffice On-Line WebSocket server version])
# try to add a git hash for a version if we're developing
-LOOLWSD_VERSION_HASH=package
-git_hash=`cd ${ac_srcdir} && git log -1 --format=%H 2> /dev/null`
+LOOLWSD_VERSION_HASH="$LOOLWSD_VERSION"
+git_hash=`cd ${srcdir} && git log -1 --format=%H 2> /dev/null`
if test "z$git_hash" != "z"; then
LOOLWSD_VERSION_HASH=$git_hash
fi
commit 1166fff924c169ba80c7ee460cb0d6190a1778e0
Author: Jan Holesovsky <kendy at collabora.com>
Date: Tue May 10 11:21:42 2016 +0200
Fix non-https build.
diff --git a/loolwsd/Connect.cpp b/loolwsd/Connect.cpp
index 341329b..3765399 100644
--- a/loolwsd/Connect.cpp
+++ b/loolwsd/Connect.cpp
@@ -48,6 +48,7 @@ using namespace LOOLProtocol;
using Poco::Net::AcceptCertificateHandler;
using Poco::Net::Context;
+using Poco::Net::HTTPClientSession;
using Poco::Net::HTTPSClientSession;
using Poco::Net::HTTPRequest;
using Poco::Net::HTTPResponse;
More information about the Libreoffice-commits
mailing list