Exemplo n.º 1
0
Usage::Usage(QObject *p) : QObject(p) {
	qbReport.open(QBuffer::ReadWrite);
	qdsReport.setDevice(&qbReport);
	qdsReport.setVersion(QDataStream::Qt_4_4);
	qdsReport << static_cast<unsigned int>(2);

	// Wait 10 minutes (so we know they're actually using this), then...
	QTimer::singleShot(60 * 10 * 1000, this, SLOT(registerUsage()));
	QTimer::singleShot(60 * 10 * 1000, this, SLOT(reportJitter()));
}
Exemplo n.º 2
0
void Usage::reportJitter() {
	QTimer::singleShot(60 * 10 * 1000, this, SLOT(reportJitter()));

	if (qbReport.size() < 1024)
		return;

	QNetworkRequest req(QUrl(QLatin1String("http://mumble.info/jitter.cgi")));
	req.setHeader(QNetworkRequest::ContentTypeHeader, QLatin1String("application/octet-stream"));

	QNetworkReply *rep = g.nam->post(req, qCompress(qbReport.buffer(), 9));
	connect(rep, SIGNAL(finished()), rep, SLOT(deleteLater()));

	qbReport.close();
	qbReport.setData(QByteArray());

	qbReport.open(QBuffer::ReadWrite);
	qdsReport.setDevice(&qbReport);
	qdsReport.setVersion(QDataStream::Qt_4_4);
	qdsReport << static_cast<unsigned int>(2);
}