2018-07-27 Fred Gleason <fredg@paravelsystems.com>

* Added a 'SaveFile' test method to the web API.
	* Added a 'SaveString' test method to the web API.
	* Refactored the multipart-mime parser in 'RDFormPost' to process
	UTF-8 strings correctly.
This commit is contained in:
Fred Gleason
2018-07-27 14:28:55 -04:00
parent 046ddb0264
commit 542fb7d6a6
18 changed files with 429 additions and 138 deletions

View File

@@ -192,7 +192,7 @@ void Xport::ListLogs()
printf("<logList>\n");
while(q->next()) {
log=new RDLog(q->value(0).toString());
printf("%s",(const char *)log->xml());
printf("%s",(const char *)log->xml().utf8());
delete log;
}
printf("</logList>\n");
@@ -233,7 +233,7 @@ void Xport::ListLog()
printf("Content-type: application/xml\n");
printf("Status: 200\n\n");
printf("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
printf("%s\n",(const char *)log_event->xml());
printf("%s\n",(const char *)log_event->xml().utf8());
Exit(0);
}
@@ -601,24 +601,24 @@ void Xport::LockLog()
addr=xport_remote_address;
lock_guid=RDLogLock::makeGuid(xport_remote_hostname);
if(RDLogLock::tryLock(&username,&stationname,&addr,log_name,lock_guid)) {
printf("%s",(const char *)LogLockXml(true,log_name,lock_guid,"","",addr));
printf("%s",(const char *)LogLockXml(true,log_name,lock_guid,"","",addr).utf8());
}
else {
printf("%s",(const char *)LogLockXml(false,log_name,"",username,
stationname,addr));
stationname,addr).utf8());
}
Exit(0);
break;
case Xport::LockLogUpdate:
RDLogLock::updateLock(log_name,lock_guid);
printf("%s",(const char *)LogLockXml(true,log_name,lock_guid,"","",addr));
printf("%s",(const char *)LogLockXml(true,log_name,lock_guid,"","",addr).utf8());
Exit(0);
break;
case Xport::LockLogClear:
RDLogLock::clearLock(lock_guid);
printf("%s",(const char *)LogLockXml(true,log_name,lock_guid,"","",addr));
printf("%s",(const char *)LogLockXml(true,log_name,lock_guid,"","",addr).utf8());
Exit(0);
break;
}