diff --git a/ismas/ismas_client.cpp b/ismas/ismas_client.cpp index 8e94f5b..170eea3 100644 --- a/ismas/ismas_client.cpp +++ b/ismas/ismas_client.cpp @@ -231,6 +231,8 @@ IsmasClient::sendRequestReceiveResponse(int port, QString const &request) { tv.tv_sec = 60; /* 60 secs timeout for read and write */ tv.tv_usec = 0; + QString const selectStart = QDateTime::currentDateTime().toString(Qt::ISODateWithMs); + int const r = select(maxfdp1, &rset, NULL, NULL, &tv); if (r < 0) { // error if (errno == EINTR) { @@ -264,7 +266,8 @@ IsmasClient::sendRequestReceiveResponse(int port, QString const &request) { if (n == 0) { // The return value will be 0 when the peer has performed an orderly shutdown. printErrorMessage(port, clientIP, clientPort, - QString("PEER CLOSED CONNECTION (") + strerror(errno) + ")"); + QString("PEER CLOSED CONNECTION (") + strerror(errno) + ") START AT" + + selectStart + " NOW " + QDateTime::currentDateTime().toString(Qt::ISODateWithMs)); ::close(sockfd); return std::nullopt; } else @@ -415,13 +418,11 @@ QString IsmasClient::updateOfPSASendVersion(PSAInstalled const &psa) { static char buf[4096*2]; memset(buf, 0, sizeof(buf)); - QString const ts = QDateTime::currentDateTime().toString(Qt::ISODateWithMs); - QString sendVersionHash = "N/A"; - // local data="#M=APISM#C=CMD_SENDVERSION#J= snprintf(buf, sizeof(buf)-1, "{" "\"VERSION_INFO\" : {" + "\"REASON\":\"%s\"," "\"CREATED\":\"%s\"," "\"HASH\":\"%s\"" "}," @@ -629,8 +630,9 @@ QString IsmasClient::updateOfPSASendVersion(PSAInstalled const &psa) { "}" "}" "}", - ts.toStdString().c_str(), - sendVersionHash.toStdString().c_str(), + psa.versionInfo.reason.toStdString().c_str(), + psa.versionInfo.created.toStdString().c_str(), + psa.versionInfo.lastCommit.toStdString().c_str(), psa.tariff.version.toStdString().c_str(), psa.tariff.project.toStdString().c_str(), diff --git a/ismas/ismas_client.h b/ismas/ismas_client.h index 97374b8..e5cc70f 100644 --- a/ismas/ismas_client.h +++ b/ismas/ismas_client.h @@ -7,6 +7,12 @@ #include struct PSAInstalled { + struct VersionInfo { + QString created; + QString reason; + QString lastCommit; + } versionInfo; + struct Tariff { QString name; QString version;