|
@@ -649,32 +649,36 @@ int cwmpService::CheckQueue(struct soap *soap, cwmpService *cwmpService1) {
|
|
|
s = std::string(_actionParameters);
|
|
|
|
|
|
} catch (mysqlpp::BadQuery er) { // handle any connection or
|
|
|
- std::cerr << "Error on IMSI-" << soap->host << " :" << er.what() << std::endl;
|
|
|
+ std::cerr << "Error on CPE with IP: " << soap->host << " :" << er.what() << std::endl;
|
|
|
}
|
|
|
conn.disconnect();
|
|
|
actionParameters = json::parse(s);
|
|
|
if (action == 1) {
|
|
|
- std::cerr << actionParameters.dump(4) << std::endl;
|
|
|
- int DelaySeconds = 1;
|
|
|
- std::string str = actionParameters["FileType"];
|
|
|
- char *FileType = new char[str.length() + 1];
|
|
|
- strcpy(FileType, str.c_str());
|
|
|
- str = actionParameters["URL"];
|
|
|
- char *URL = new char[str.length() + 1];
|
|
|
- strcpy(URL, str.c_str());
|
|
|
- char *Username = NULL;
|
|
|
- char *Password = NULL;
|
|
|
- int FileSize = std::stoi(std::string(actionParameters["FilesSize"]));
|
|
|
- char *TargetFileName = NULL;
|
|
|
- str = actionParameters["SuccessURL"];
|
|
|
- char *SuccessURL = new char[str.length() + 1];
|
|
|
- strcpy(SuccessURL, str.c_str());
|
|
|
- str = actionParameters["FailureURL"];
|
|
|
- char *FailureURL = new char[str.length() + 1];
|
|
|
- strcpy(FailureURL, str.c_str());
|
|
|
-
|
|
|
- return CustomeDownload(soap, this, DelaySeconds, FileType, URL, Username, Password, FileSize, TargetFileName,
|
|
|
- SuccessURL, FailureURL);
|
|
|
+ try {
|
|
|
+ std::cerr << actionParameters.dump(4) << std::endl;
|
|
|
+ int DelaySeconds = 1;
|
|
|
+ std::string str = actionParameters["FileType"];
|
|
|
+ char *FileType = new char[str.length() + 1];
|
|
|
+ strcpy(FileType, str.c_str());
|
|
|
+ str = actionParameters["URL"];
|
|
|
+ char *URL = new char[str.length() + 1];
|
|
|
+ strcpy(URL, str.c_str());
|
|
|
+ char *Username = NULL;
|
|
|
+ char *Password = NULL;
|
|
|
+ int FileSize = std::stoi(std::string(actionParameters["FilesSize"]));
|
|
|
+ char *TargetFileName = NULL;
|
|
|
+ str = actionParameters["SuccessURL"];
|
|
|
+ char *SuccessURL = new char[str.length() + 1];
|
|
|
+ strcpy(SuccessURL, str.c_str());
|
|
|
+ str = actionParameters["FailureURL"];
|
|
|
+ char *FailureURL = new char[str.length() + 1];
|
|
|
+ strcpy(FailureURL, str.c_str());
|
|
|
+
|
|
|
+ return CustomeDownload(soap, this, DelaySeconds, FileType, URL, Username, Password, FileSize, TargetFileName,
|
|
|
+ SuccessURL, FailureURL);
|
|
|
+ } catch (std::exception ex) { // handle any connection or
|
|
|
+ std::cerr << "Error on CPE with IP: " << soap->host << " :" << ex.what() << std::endl;
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
//
|