Browse Source

- Removed some useless debug

- Increased httpserver update interval
adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
a73d3132df
  1. 2
      src/GUI.cpp
  2. 9
      src/httprequestparser.cpp
  3. 4
      src/httpserver.cpp

2
src/GUI.cpp

@ -1535,7 +1535,7 @@ bool GUI::initWebUi(QString username, QString password, int port)
httpServer->close(); httpServer->close();
} }
else else
httpServer = new HttpServer(BTSession, 2000, this); httpServer = new HttpServer(BTSession, 3000, this);
httpServer->setAuthorization(username, password); httpServer->setAuthorization(username, password);
bool success = httpServer->listen(QHostAddress::Any, port); bool success = httpServer->listen(QHostAddress::Any, port);
if (success) if (success)

9
src/httprequestparser.cpp

@ -92,13 +92,13 @@ void HttpRequestParser::write(QByteArray str)
data.clear(); data.clear();
QUrl url = QUrl::fromEncoded(QHttpRequestHeader::path().toAscii()); QUrl url = QUrl::fromEncoded(QHttpRequestHeader::path().toAscii());
path = url.path(); path = url.path();
qDebug() << path; //() << path;
QListIterator<QPair<QString, QString> > i(url.queryItems()); QListIterator<QPair<QString, QString> > i(url.queryItems());
while (i.hasNext()) while (i.hasNext())
{ {
QPair<QString, QString> pair = i.next(); QPair<QString, QString> pair = i.next();
getMap[pair.first] = pair.second; getMap[pair.first] = pair.second;
qDebug() << pair.first << "=" << get(pair.first); //qDebug() << pair.first << "=" << get(pair.first);
} }
} }
} }
@ -122,7 +122,7 @@ void HttpRequestParser::write(QByteArray str)
{ {
QPair<QString, QString> pair = i.next(); QPair<QString, QString> pair = i.next();
postMap[pair.first] = pair.second; postMap[pair.first] = pair.second;
qDebug() << pair.first << "=" << post(pair.first); //qDebug() << pair.first << "=" << post(pair.first);
} }
} }
if(contentType() == "multipart/form-data") if(contentType() == "multipart/form-data")
@ -134,6 +134,5 @@ void HttpRequestParser::write(QByteArray str)
} }
else else
error = true; error = true;
} }
qDebug() << "isError: " << isError();
} }

4
src/httpserver.cpp

@ -76,7 +76,6 @@ void HttpServer::newHttpConnection()
void HttpServer::onTimer() void HttpServer::onTimer()
{ {
qDebug("EventManager Timer Start");
QStringList list = BTSession->getUnfinishedTorrents(); QStringList list = BTSession->getUnfinishedTorrents();
foreach(QString hash, list) { foreach(QString hash, list) {
QTorrentHandle h = BTSession->getTorrentHandle(hash); QTorrentHandle h = BTSession->getTorrentHandle(hash);
@ -86,8 +85,7 @@ void HttpServer::onTimer()
foreach(QString hash, list) { foreach(QString hash, list) {
QTorrentHandle h = BTSession->getTorrentHandle(hash); QTorrentHandle h = BTSession->getTorrentHandle(hash);
if(h.is_valid()) manager->modifiedTorrent(h); if(h.is_valid()) manager->modifiedTorrent(h);
} }
qDebug("EventManager Timer Stop");
} }
void HttpServer::setAuthorization(QString username, QString password) void HttpServer::setAuthorization(QString username, QString password)

Loading…
Cancel
Save