Changeset 2339
- Timestamp:
- 02/06/08 00:32:54 (11 months ago)
- Location:
- vidalia/trunk/src/torcontrol
- Files:
-
- 5 modified
-
addressmap.cpp (modified) (1 diff)
-
controlconnection.cpp (modified) (13 diffs)
-
controlsocket.cpp (modified) (1 diff)
-
debug.h (modified) (1 diff)
-
torprocess.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vidalia/trunk/src/torcontrol/addressmap.cpp
r2304 r2339 39 39 AddressMap::add(QString from, QString to, QDateTime expires) 40 40 { 41 log::debug("New address mapping: %1 -> %2 (expires %3)").arg(from)41 tc::debug("New address mapping: %1 -> %2 (expires %3)").arg(from) 42 42 .arg(to) 43 43 .arg(expires.isValid() ? expires.toString(DATE_FMT) -
vidalia/trunk/src/torcontrol/controlconnection.cpp
r2304 r2339 61 61 { 62 62 if (isRunning()) { 63 log::error("Bug: Tried to call ControlConnection::connect() when the "63 tc::error("Bug: Tried to call ControlConnection::connect() when the " 64 64 "control thread is already running."); 65 65 return; … … 84 84 { 85 85 _connectAttempt++; 86 log::debug("Connecting to Tor (Attempt %1 of %2)").arg(_connectAttempt)86 tc::debug("Connecting to Tor (Attempt %1 of %2)").arg(_connectAttempt) 87 87 .arg(MAX_CONNECT_ATTEMPTS); 88 88 … … 131 131 if (error == QAbstractSocket::ConnectionRefusedError && 132 132 _connectAttempt < MAX_CONNECT_ATTEMPTS) { 133 log::debug("Control connection refused. Retrying in %1ms.")133 tc::debug("Control connection refused. Retrying in %1ms.") 134 134 .arg(CONNECT_RETRY_DELAY); 135 135 _connectTimer->start(CONNECT_RETRY_DELAY); … … 137 137 /* Exceeded maximum number of connect attempts. Give up. */ 138 138 QString errstr = ControlSocket::toString(error); 139 log::error("Vidalia was unable to connect to Tor: %1").arg(errstr);139 tc::error("Vidalia was unable to connect to Tor: %1").arg(errstr); 140 140 emit connectFailed(tr("Vidalia was unable to connect to Tor. (%1)") 141 141 .arg(errstr)); … … 145 145 /* Tor closed the connection. This is common when we send a 'shutdown' or 146 146 * 'halt' signal to Tor and doesn't need to be logged as loudly. */ 147 log::warn("Tor closed the control connection.");147 tc::warn("Tor closed the control connection."); 148 148 } else { 149 149 /* Some other error. */ 150 150 /*XXX We may want to be emitting these so the GUI thread can learn about 151 151 * them and display an error message. */ 152 log::error("Control socket error: %1").arg(ControlSocket::toString(error));152 tc::error("Control socket error: %1").arg(ControlSocket::toString(error)); 153 153 } 154 154 } … … 158 158 ControlConnection::cancelConnect() 159 159 { 160 log::warn("Control connection attempt cancelled.");160 tc::warn("Control connection attempt cancelled."); 161 161 setStatus(Disconnected); 162 162 exit(0); … … 200 200 { 201 201 QMutexLocker locker(&_statusMutex); 202 log::debug("Control connection status changed from '%1' to '%2'")202 tc::debug("Control connection status changed from '%1' to '%2'") 203 203 .arg(statusString(_status)) 204 204 .arg(statusString(status)); … … 223 223 result = w->getResult(&reply, &errstr); 224 224 if (!result) 225 log::error("Failed to receive control reply: %1").arg(errstr);225 tc::error("Failed to receive control reply: %1").arg(errstr); 226 226 delete w; 227 227 } else { 228 log::error("Failed to send control command (%1): %2").arg(cmd.keyword())228 tc::error("Failed to send control command (%1): %2").arg(cmd.keyword()) 229 229 .arg(errstr); 230 230 _recvMutex.unlock(); … … 248 248 _connMutex.lock(); 249 249 if (!_sock || _status != Connected) { 250 log::warn("Unable to send control command '%1' when socket status is '%2'")250 tc::warn("Unable to send control command '%1' when socket status is '%2'") 251 251 .arg(cmd.keyword()).arg(_status); 252 252 _connMutex.unlock(); … … 286 286 if (reply.getStatus() == "650") { 287 287 /* Asynchronous event message */ 288 log::debug("Control Event: %1").arg(reply.toString());288 tc::debug("Control Event: %1").arg(reply.toString()); 289 289 290 290 if (_events) { … … 293 293 } else { 294 294 /* Response to a previous command */ 295 log::debug("Control Reply: %1").arg(reply.toString());295 tc::debug("Control Reply: %1").arg(reply.toString()); 296 296 297 297 _recvMutex.lock(); … … 303 303 } 304 304 } else { 305 log::error("Unable to read control reply: %1").arg(errmsg);305 tc::error("Unable to read control reply: %1").arg(errmsg); 306 306 } 307 307 } … … 370 370 /* Attempt to connect to Tor */ 371 371 connect(); 372 log::debug("Starting control connection event loop.");372 tc::debug("Starting control connection event loop."); 373 373 exec(); 374 log::debug("Exited control connection event loop.");374 tc::debug("Exited control connection event loop."); 375 375 376 376 /* Clean up the socket */ -
vidalia/trunk/src/torcontrol/controlsocket.cpp
r2304 r2339 65 65 /* Format the control command */ 66 66 QString strCmd = cmd.toString(); 67 log::debug("Control Command: %1").arg(strCmd.trimmed());67 tc::debug("Control Command: %1").arg(strCmd.trimmed()); 68 68 69 69 /* Attempt to send the command to Tor */ -
vidalia/trunk/src/torcontrol/debug.h
r2303 r2339 34 34 35 35 36 namespace log{36 namespace tc { 37 37 38 38 class Message { -
vidalia/trunk/src/torcontrol/torprocess.cpp
r2312 r2339 88 88 setEnvironment(env); 89 89 90 log::debug("Starting Tor using '%1 %2'").arg(app).arg(formatArguments(args));90 tc::debug("Starting Tor using '%1 %2'").arg(app).arg(formatArguments(args)); 91 91 QProcess::start(exe, args, QIODevice::ReadOnly | QIODevice::Text); 92 92 } … … 102 102 } 103 103 104 log::debug("Stopping the Tor process.");104 tc::debug("Stopping the Tor process."); 105 105 /* Tell the process to stop */ 106 106 #if defined(Q_OS_WIN32) … … 113 113 /* Wait for it to complete */ 114 114 if (!waitForFinished(5000)) { 115 log::error("Tor failed to stop: %1").arg(errorString());115 tc::error("Tor failed to stop: %1").arg(errorString()); 116 116 if (errmsg) { 117 117 *errmsg = … … 182 182 { 183 183 if (error == QProcess::FailedToStart) { 184 log::error("The Tor process failed to start: %1").arg(errorString());184 tc::error("The Tor process failed to start: %1").arg(errorString()); 185 185 /* Tor didn't start, so let everyone know why. */ 186 186 emit startFailed(errorString()); 187 187 } else { 188 log::error("Tor process error: %1").arg(errorString());188 tc::error("Tor process error: %1").arg(errorString()); 189 189 } 190 190 }
