From 3b6c25b0f341a61d89991d0fe55553763f517cd0 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Mon, 3 Aug 2020 16:12:57 -0300 Subject: [PATCH] Updating release check. --- client/src/session/local/init.cc | 18 ++++++++++++++++-- server/src/core/tools.c | 2 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/client/src/session/local/init.cc b/client/src/session/local/init.cc index 4507923..9603f7d 100644 --- a/client/src/session/local/init.cc +++ b/client/src/session/local/init.cc @@ -74,9 +74,23 @@ // Setup callbacks struct lib3270_session_callbacks *cbk; - cbk = lib3270_get_session_callbacks(this->hSession,sizeof(struct lib3270_session_callbacks)); + cbk = lib3270_get_session_callbacks(this->hSession,LIB3270_STRINGIZE_VALUE_OF(LIB3270_REVISION),sizeof(struct lib3270_session_callbacks)); if(!cbk) { - throw runtime_error( _("Invalid callback table, possible version mismatch in lib3270") ); + + string message(_("Invalid callback table; ")); + message += "lib"; + message += LIB3270_STRINGIZE_VALUE_OF(LIB3270_NAME); + + if(strcasecmp(LIB3270_STRINGIZE_VALUE_OF(LIB3270_REVISION),lib3270_get_revision())) { + message += _(" is not in the required revision " ); + message += LIB3270_STRINGIZE_VALUE_OF(LIB3270_REVISION); + message += "."; + } else { + message += _(" is invalid."); + } + + throw runtime_error(message); + } cbk->update_connect = connectHandler; diff --git a/server/src/core/tools.c b/server/src/core/tools.c index 146fca2..9d7a68e 100644 --- a/server/src/core/tools.c +++ b/server/src/core/tools.c @@ -28,6 +28,8 @@ */ #include +#include +#include #include /*--[ Implement ]------------------------------------------------------------------------------------*/ -- libgit2 0.21.2