From 0ad2115d82344186da75597f612897b3a10b29c6 Mon Sep 17 00:00:00 2001 From: Ko van der Sloot Date: Thu, 5 Dec 2024 10:51:07 +0100 Subject: [PATCH] Squashed commit of the following: updated to latest ticcutils --- .github/workflows/timblserver.yml | 6 +++++- configure.ac | 2 +- src/HttpServer.cxx | 18 +++++++++++------- src/TimblServer.cxx | 6 +++--- src/TimblThread.cxx | 2 +- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/timblserver.yml b/.github/workflows/timblserver.yml index 5e02a80..2c23234 100644 --- a/.github/workflows/timblserver.yml +++ b/.github/workflows/timblserver.yml @@ -5,7 +5,9 @@ on: schedule: - cron: "0 20 3 * 5" # run test once a month push: - branches: [master] + branches: + - master + - develop paths: - configure.ac - 'src/**' @@ -44,10 +46,12 @@ jobs: - uses: LanguageMachines/ticcactions/cpp-submodule-build@v1 with: + branch: ${{ github.ref_name }} module: ticcutils - uses: LanguageMachines/ticcactions/cpp-submodule-build@v1 with: + branch: ${{ github.ref_name }} module: timbl - uses: LanguageMachines/ticcactions/setup-cppcheck@v1 diff --git a/configure.ac b/configure.ac index b87c53c..3bac190 100644 --- a/configure.ac +++ b/configure.ac @@ -61,7 +61,7 @@ else fi AC_OSX_PKG( [icu4c] ) -PKG_CHECK_MODULES([ticcutils], [ticcutils >= 0.35] ) +PKG_CHECK_MODULES([ticcutils], [ticcutils >= 0.36] ) CXXFLAGS="$CXXFLAGS $ticcutils_CFLAGS" LIBS="$LIBS $ticcutils_LIBS" diff --git a/src/HttpServer.cxx b/src/HttpServer.cxx index dd6713a..772d749 100644 --- a/src/HttpServer.cxx +++ b/src/HttpServer.cxx @@ -116,12 +116,16 @@ void HttpServer::callback( childArgs *args ){ if ( client ){ TiCC::LogStream LS( &logstream() ); TiCC::LogStream DS( &logstream() ); - DS.message(logLine); - LS.message(logLine); - DS.setstamp( StampBoth ); - LS.setstamp( StampBoth ); - TiCC::XmlDoc doc( "TiMblResult" ); - xmlNode *root = doc.getRoot(); + DS.set_message(logLine); + LS.set_message(logLine); + DS.set_stamp( StampBoth ); + LS.set_stamp( StampBoth ); + xmlDoc *doc = xmlNewDoc( TiCC::to_xmlChar("1.0") ); + xmlNode *root = xmlNewDocNode( doc, + 0, + TiCC::to_xmlChar("TiMblResult" ), + 0 ); + xmlDocSetRootElement( doc, root ); TiCC::XmlSetAttribute( root, "algorithm", TiCC::toString(client->_exp->Algorithm()) ); vector avs = TiCC::split_at( qstring, "&" ); @@ -237,7 +241,7 @@ void HttpServer::callback( childArgs *args ){ ++it; } } - string out_line = doc.toString(); + string out_line = TiCC::serialize(*doc); timeout=10; nb_putline( args->os(), out_line , timeout ); delete client; diff --git a/src/TimblServer.cxx b/src/TimblServer.cxx index 6a79367..00b0b29 100644 --- a/src/TimblServer.cxx +++ b/src/TimblServer.cxx @@ -259,15 +259,15 @@ int main(int argc, char *argv[]){ } if ( protocol == "tcp" ){ server = new TcpServer( config ); - server->logstream().message("tcp_server"); + server->logstream().set_message("tcp_server"); } else if ( protocol == "http" ){ server = new HttpServer( config ); - server->logstream().message("http_server"); + server->logstream().set_message("http_server"); } else if ( protocol == "json" ){ server = new JsonServer( config ); - server->logstream().message("json_server"); + server->logstream().set_message("json_server"); } else { cerr << "unknown protocol " << protocol << endl; diff --git a/src/TimblThread.cxx b/src/TimblThread.cxx index 0c4cc76..e009da6 100644 --- a/src/TimblThread.cxx +++ b/src/TimblThread.cxx @@ -56,7 +56,7 @@ TimblThread::TimblThread( TimblExperiment *exp, is(args->is()) { if ( doDebug ){ - myLog.setlevel(LogHeavy); + myLog.set_level(LogHeavy); } _exp = exp->clone(); *_exp = *exp;