From adc6cf214a5b65dd154eedd7e3de8731930d3fcd Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 10 Nov 2021 14:54:42 +0100 Subject: [PATCH] fixed runtime error with module::sendprogram default servername value --- .../bin/jungfrauDetectorServer_developer | Bin 279800 -> 279800 bytes slsDetectorSoftware/src/Module.cpp | 10 ++++++---- slsDetectorSoftware/src/Module.h | 2 +- slsSupportLib/include/sls/versionAPI.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index 2c35210b25fbae527123601de910b184c56ab865..90439af52e8eab3088274f70348bde110fc41413 100755 GIT binary patch delta 32 ocmey-DfpvPaDo=oxuWS0YnUY(U0PijTV0r1U6{AJuxxPw0OD^9O8@`> delta 32 ocmey-DfpvPaDo=oVY}%MYnUY(U0PijTV0r1U6{AJuxxPw0NnZv3;+NC diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 4d450a903..44b25d1c2 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -3466,7 +3466,7 @@ sls_detector_module Module::readSettingsFile(const std::string &fname, void Module::sendProgram(bool blackfin, std::vector buffer, const int functionEnum, const std::string &functionType, - const std::string &serverName) { + const std::string serverName) { LOG(logINFO) << "Module " << moduleIndex << " (" << shm()->hostname << "): Sending " << functionType; @@ -3484,9 +3484,11 @@ void Module::sendProgram(bool blackfin, std::vector buffer, client.Send(cChecksum); // send server name - char sname[MAX_STR_LENGTH] = {0}; - strcpy(sname, serverName.c_str()); - client.Send(sname); + if (functionEnum == F_UPDATE_DETECTOR_SERVER) { + char sname[MAX_STR_LENGTH] = {0}; + strcpy(sname, serverName.c_str()); + client.Send(sname); + } // validate memory allocation etc in detector if (client.Receive() == FAIL) { diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index 9f5cae22e..0750fb941 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -751,7 +751,7 @@ class Module : public virtual slsDetectorDefs { bool trimbits = true); void sendProgram(bool blackfin, std::vector buffer, const int functionEnum, const std::string &functionType, - const std::string &serverName = nullptr); + const std::string serverName = ""); void simulatingActivityinDetector(const std::string &functionType, const int timeRequired); diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index cb56b7807..b0cf7fa62 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -9,7 +9,7 @@ #define APICTB 0x211110 #define APIGOTTHARD 0x211110 #define APIGOTTHARD2 0x211110 -#define APIJUNGFRAU 0x211110 #define APIMYTHEN3 0x211110 #define APIMOENCH 0x211110 #define APIEIGER 0x211110 +#define APIJUNGFRAU 0x211110