Commit 35bcde59 by 刘帅

1. 修改冲正逻辑,去掉控制信息发送、校验冲正返回结果

2. 添加版权信息
parent c1dc8f8f
#ifndef APP_SINGLE
// app_single.h
//
// Copyright (c) 2015-2019 Freemud Co., Ltd.
//
// Distributed under the OpenSSL Software License.
// (See accompanying file at https://github.com/openssl/openssl/blob/master/LICENSE)
#ifndef APP_SINGLE
#define APP_SINGLE
#if defined WIN32 //for win
......
......@@ -1031,6 +1031,7 @@ void QFmClient::run()
CloseSocket(&_acceptedSock);
continue;
}
//CloseSocket(&_acceptedSock); //test roll back
QJsonObject object;
char temp_recv[MAX_BUF_LEN] = {0};
strcpy(temp_recv, _recvbuf);
......@@ -1280,14 +1281,14 @@ void QFmClient::CheckRollBackData()
QLOG_INFO() << "roll back data: connect ZH Proxy failed, will try after 5 seconds...\r\n";
continue;
}
#ifndef AES_ENCRYPT
if (0 != SendCtrlInfo2Proxy())
{
qDebug() << "roll back data: send ctrl info 2 ZH Proxy failed, will try after 5 seconds...\r\n";
QLOG_INFO() << "roll back data: send ctrl info 2 ZH Proxy failed, will try after 5 seconds...\r\n";
continue;
}
#endif
if (0 != SendData2ZhProxyAndWaitRspData())
{
qDebug() << "roll back data: send data to proxy fail, will try after 5 seconds...\r\n";
......@@ -1295,7 +1296,22 @@ void QFmClient::CheckRollBackData()
continue;
}
break;
//对冲正结果进行判断
QByteArray recvdata(_recvbuf);
QLOG_INFO() << "roll back reply: " << _recvbuf;
QJsonParseError json_error;
QJsonDocument doc = QJsonDocument::fromJson(recvdata, &json_error);
if(json_error.error != QJsonParseError::NoError || !doc.isObject())
{
qDebug() << "error request json data!\r\n";
continue;
}
QJsonObject object = doc.object();
if(object.contains("statusCode")) //{"statusCode":100}
{
if(object["statusCode"] == 100)
break;
}
}while(1);
qDebug() << "roll back ok!\r\n";
......
#ifndef QFMCLIENT_H
// qfmclient.h
//
// Copyright (c) 2015-2019 Freemud Co., Ltd.
//
// This is the main control flow file.
// we wait the connection from NewPos, Once has request from NewPos, preprocess the request.
// Then send the request to proxy and wait the response.
// After get the response from proxy, send the response to NewPos.
//
// Distributed under the OpenSSL Software License.
// (See accompanying file at https://github.com/openssl/openssl/blob/master/LICENSE)
#ifndef QFMCLIENT_H
#define QFMCLIENT_H
#include <QThread>
......
// scanner.h
//
// Copyright (c) 2015-2019 Freemud Co., Ltd.
//
// Distributed under the OpenSSL Software License.
// (See accompanying file at https://github.com/openssl/openssl/blob/master/LICENSE)
#ifndef SCANNER_H
#define SCANNER_H
......
// utility.h
//
// Copyright (c) 2015-2019 Freemud Co., Ltd.
//
// Distributed under the OpenSSL Software License.
// (See accompanying file at https://github.com/openssl/openssl/blob/master/LICENSE)
#ifndef UTILITY
#define UTILITY
......
// widget.h
//
// Copyright (c) 2015-2019 Freemud Co., Ltd.
//
// Distributed under the OpenSSL Software License.
// (See accompanying file at https://github.com/openssl/openssl/blob/master/LICENSE)
#ifndef WIDGET_H
#define WIDGET_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment