|
|
@ -340,7 +340,7 @@ void Toplevel::slotSendReportBacktraceDone(const TQString &str)
|
|
|
|
TQCString proofOfWork(TQUuid::createUuid().toString().ascii());
|
|
|
|
TQCString proofOfWork(TQUuid::createUuid().toString().ascii());
|
|
|
|
memcpy(m_backtraceSubmissionData.data() + proofOfWorkPos, proofOfWork.data(), proofOfWork.size());
|
|
|
|
memcpy(m_backtraceSubmissionData.data() + proofOfWorkPos, proofOfWork.data(), proofOfWork.size());
|
|
|
|
sha.reset();
|
|
|
|
sha.reset();
|
|
|
|
sha.process(m_backtraceSubmissionData.data(), m_backtraceSubmissionData.size());
|
|
|
|
sha.process(m_backtraceSubmissionData.data(), m_backtraceSubmissionData.size()-1);
|
|
|
|
memcpy(hash.data(), sha.hash(), hash.size());
|
|
|
|
memcpy(hash.data(), sha.hash(), hash.size());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -376,7 +376,7 @@ void Toplevel::slotSendReportBacktraceDone(const TQString &str)
|
|
|
|
m_bugdescription = 0;
|
|
|
|
m_bugdescription = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int Toplevel::postCrashDataToServer(TQByteArray data) {
|
|
|
|
int Toplevel::postCrashDataToServer(TQCString data) {
|
|
|
|
m_serverResponse = "";
|
|
|
|
m_serverResponse = "";
|
|
|
|
TQCString formDataBoundary = "-----------------------------------DrKonqiCrashReporterBoundary";
|
|
|
|
TQCString formDataBoundary = "-----------------------------------DrKonqiCrashReporterBoundary";
|
|
|
|
|
|
|
|
|
|
|
@ -386,16 +386,18 @@ int Toplevel::postCrashDataToServer(TQByteArray data) {
|
|
|
|
postData += "\r\n";
|
|
|
|
postData += "\r\n";
|
|
|
|
postData += "Content-Disposition: form-data; name=\"crashreport\"; filename=\"crashreport.txt\"\r\n";
|
|
|
|
postData += "Content-Disposition: form-data; name=\"crashreport\"; filename=\"crashreport.txt\"\r\n";
|
|
|
|
postData += "Content-Type: application/octet-stream\r\n";
|
|
|
|
postData += "Content-Type: application/octet-stream\r\n";
|
|
|
|
|
|
|
|
postData += (TQString("Content-Length: %1\r\n").arg(data.count())).ascii();
|
|
|
|
postData += "Content-Transfer-Encoding: binary\r\n\r\n";
|
|
|
|
postData += "Content-Transfer-Encoding: binary\r\n\r\n";
|
|
|
|
postData += data;
|
|
|
|
postData += data;
|
|
|
|
|
|
|
|
postData += "\r\n";
|
|
|
|
postData += "--";
|
|
|
|
postData += "--";
|
|
|
|
postData += formDataBoundary;
|
|
|
|
postData += formDataBoundary;
|
|
|
|
postData += "--";
|
|
|
|
postData += "--\r\n";
|
|
|
|
|
|
|
|
|
|
|
|
KURL url("https://crashreport.trinitydesktop.org/");
|
|
|
|
KURL url("https://crashreport.trinitydesktop.org/");
|
|
|
|
// TDEIO::TransferJob* job = TDEIO::http_post(url, postData, false);
|
|
|
|
// TDEIO::TransferJob* job = TDEIO::http_post(url, postData, false);
|
|
|
|
TDEIO::TransferJob* job = TDEIO::http_post(url, postData, true);
|
|
|
|
TDEIO::TransferJob* job = TDEIO::http_post(url, postData, true);
|
|
|
|
job->addMetaData("content-type", TQString("Content-Type: multipart/form-data, boundary=%1").arg(formDataBoundary));
|
|
|
|
job->addMetaData("content-type", TQString("Content-Type: multipart/form-data; boundary=%1").arg(formDataBoundary));
|
|
|
|
job->addMetaData("referrer", "http://drkonqi-client.crashreport.trinitydesktop.org");
|
|
|
|
job->addMetaData("referrer", "http://drkonqi-client.crashreport.trinitydesktop.org");
|
|
|
|
connect(job, TQT_SIGNAL(data(TDEIO::Job *, const TQByteArray &)), TQT_SLOT(postCrashDataToServerData(TDEIO::Job *, const TQByteArray &)));
|
|
|
|
connect(job, TQT_SIGNAL(data(TDEIO::Job *, const TQByteArray &)), TQT_SLOT(postCrashDataToServerData(TDEIO::Job *, const TQByteArray &)));
|
|
|
|
connect(job, TQT_SIGNAL(result(TDEIO::Job *)), TQT_SLOT(postCrashDataToServerResult(TDEIO::Job *)));
|
|
|
|
connect(job, TQT_SIGNAL(result(TDEIO::Job *)), TQT_SLOT(postCrashDataToServerResult(TDEIO::Job *)));
|
|
|
@ -449,10 +451,12 @@ void Toplevel::postCrashDataToServerResult(TDEIO::Job *job)
|
|
|
|
if (i == KMessageBox::No) {
|
|
|
|
if (i == KMessageBox::No) {
|
|
|
|
postCrashDataToServer(m_backtraceSubmissionData);
|
|
|
|
postCrashDataToServer(m_backtraceSubmissionData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (i == KMessageBox::Yes) {
|
|
|
|
if (i == KMessageBox::Yes) {
|
|
|
|
|
|
|
|
saveOfflineCrashReport(m_backtraceSubmissionData);
|
|
|
|
saveOfflineCrashReport(m_backtraceSubmissionData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
enableButton(User3, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
@ -464,14 +468,16 @@ void Toplevel::postCrashDataToServerResult(TDEIO::Job *job)
|
|
|
|
if (i == KMessageBox::No) {
|
|
|
|
if (i == KMessageBox::No) {
|
|
|
|
postCrashDataToServer(m_backtraceSubmissionData);
|
|
|
|
postCrashDataToServer(m_backtraceSubmissionData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (i == KMessageBox::Yes) {
|
|
|
|
if (i == KMessageBox::Yes) {
|
|
|
|
|
|
|
|
saveOfflineCrashReport(m_backtraceSubmissionData);
|
|
|
|
saveOfflineCrashReport(m_backtraceSubmissionData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
enableButton(User3, true);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int Toplevel::saveOfflineCrashReport(TQByteArray data)
|
|
|
|
int Toplevel::saveOfflineCrashReport(TQCString data)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQString defname = m_krashconf->execName() + TQString::fromLatin1( ".tdecrash" );
|
|
|
|
TQString defname = m_krashconf->execName() + TQString::fromLatin1( ".tdecrash" );
|
|
|
|
if( defname.contains( '/' ))
|
|
|
|
if( defname.contains( '/' ))
|
|
|
@ -495,7 +501,7 @@ int Toplevel::saveOfflineCrashReport(TQByteArray data)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (f.open(IO_WriteOnly)) {
|
|
|
|
if (f.open(IO_WriteOnly)) {
|
|
|
|
f.writeBlock(data.data(), data.count());
|
|
|
|
f.writeBlock(data.data(), data.count()-1);
|
|
|
|
f.close();
|
|
|
|
f.close();
|
|
|
|
enableButton(User3, true);
|
|
|
|
enableButton(User3, true);
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|