-rw-r--r-- | core/qws/qcopbridge.cpp | 18 | ||||
-rw-r--r-- | core/qws/transferserver.cpp | 82 |
2 files changed, 54 insertions, 46 deletions
diff --git a/core/qws/qcopbridge.cpp b/core/qws/qcopbridge.cpp index 4fd0807..822efb7 100644 --- a/core/qws/qcopbridge.cpp +++ b/core/qws/qcopbridge.cpp | |||
@@ -23,2 +23,3 @@ | |||
23 | 23 | ||
24 | /* OPIE */ | ||
24 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
@@ -26,3 +27,5 @@ | |||
26 | #include <qpe/version.h> | 27 | #include <qpe/version.h> |
28 | #include <opie2/odebug.h> | ||
27 | 29 | ||
30 | /* QT */ | ||
28 | #include <qtextstream.h> | 31 | #include <qtextstream.h> |
@@ -32,2 +35,3 @@ | |||
32 | 35 | ||
36 | /* STD */ | ||
33 | #define _XOPEN_SOURCE | 37 | #define _XOPEN_SOURCE |
@@ -52,3 +56,3 @@ QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent , | |||
52 | if ( !ok() ) | 56 | if ( !ok() ) |
53 | qWarning( "Failed to bind to port %d", port ); | 57 | owarn << "Failed to bind to port " << port << "" << oendl; |
54 | else { | 58 | else { |
@@ -112,3 +116,3 @@ void QCopBridge::desktopMessage( const QCString &command, const QByteArray &args | |||
112 | if ( paren <= 0 ) { | 116 | if ( paren <= 0 ) { |
113 | qDebug("DesktopMessage: bad qcop syntax"); | 117 | odebug << "DesktopMessage: bad qcop syntax" << oendl; |
114 | return; | 118 | return; |
@@ -118,3 +122,3 @@ void QCopBridge::desktopMessage( const QCString &command, const QByteArray &args | |||
118 | if ( params[params.length()-1] != ')' ) { | 122 | if ( params[params.length()-1] != ')' ) { |
119 | qDebug("DesktopMessage: bad qcop syntax"); | 123 | odebug << "DesktopMessage: bad qcop syntax" << oendl; |
120 | return; | 124 | return; |
@@ -145,3 +149,3 @@ void QCopBridge::desktopMessage( const QCString &command, const QByteArray &args | |||
145 | } else { | 149 | } else { |
146 | qDebug(" cannot route the argument type %s throught the qcop bridge", (*it).latin1() ); | 150 | odebug << " cannot route the argument type " << (*it) << " throught the qcop bridge" << oendl; |
147 | return; | 151 | return; |
@@ -237,3 +241,3 @@ void QCopBridgePI::connectionClosed() | |||
237 | emit connectionClosed( this ); | 241 | emit connectionClosed( this ); |
238 | // qDebug( "Debug: Connection closed" ); | 242 | // odebug << "Debug: Connection closed" << oendl; |
239 | delete this; | 243 | delete this; |
@@ -252,3 +256,3 @@ void QCopBridgePI::send( const QString& msg ) | |||
252 | os << msg << endl; | 256 | os << msg << endl; |
253 | //qDebug( "sending qcop message: %s", msg.latin1() ); | 257 | //odebug << "sending qcop message: " << msg << "" << oendl; |
254 | } | 258 | } |
@@ -263,3 +267,3 @@ void QCopBridgePI::process( const QString& message ) | |||
263 | { | 267 | { |
264 | //qDebug( "Command: %s", message.latin1() ); | 268 | //odebug << "Command: " << message << "" << oendl; |
265 | 269 | ||
diff --git a/core/qws/transferserver.cpp b/core/qws/transferserver.cpp index d0fec89..777c384 100644 --- a/core/qws/transferserver.cpp +++ b/core/qws/transferserver.cpp | |||
@@ -19,2 +19,6 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | |||
21 | /* OPIE */ | ||
22 | #include <opie2/odebug.h> | ||
23 | |||
20 | #define _XOPEN_SOURCE | 24 | #define _XOPEN_SOURCE |
@@ -76,3 +80,3 @@ TransferServer::TransferServer( Q_UINT16 port, QObject *parent , | |||
76 | if ( !ok() ) | 80 | if ( !ok() ) |
77 | qWarning( "Failed to bind to port %d", port ); | 81 | owarn << "Failed to bind to port " << port << "" << oendl; |
78 | } | 82 | } |
@@ -319,3 +323,3 @@ void ServerPI::connectionClosed() | |||
319 | { | 323 | { |
320 | // qDebug( "Debug: Connection closed" ); | 324 | // odebug << "Debug: Connection closed" << oendl; |
321 | delete this; | 325 | delete this; |
@@ -327,3 +331,3 @@ void ServerPI::send( const QString& msg ) | |||
327 | os << msg << endl; | 331 | os << msg << endl; |
328 | //qDebug( "Reply: %s", msg.latin1() ); | 332 | //odebug << "Reply: " << msg << "" << oendl; |
329 | } | 333 | } |
@@ -368,3 +372,3 @@ void ServerPI::process( const QString& message ) | |||
368 | { | 372 | { |
369 | //qDebug( "Command: %s", message.latin1() ); | 373 | //odebug << "Command: " << message << "" << oendl; |
370 | 374 | ||
@@ -393,3 +397,3 @@ void ServerPI::process( const QString& message ) | |||
393 | 397 | ||
394 | //qDebug( "args: %s", args.latin1() ); | 398 | //odebug << "args: " << args << "" << oendl; |
395 | 399 | ||
@@ -529,3 +533,3 @@ void ServerPI::process( const QString& message ) | |||
529 | else { | 533 | else { |
530 | qDebug("550 Requested action not taken"); | 534 | odebug << "550 Requested action not taken" << oendl; |
531 | send( "550 Requested action not taken" ); | 535 | send( "550 Requested action not taken" ); |
@@ -635,3 +639,3 @@ void ServerPI::process( const QString& message ) | |||
635 | if ( args.isEmpty() ) { | 639 | if ( args.isEmpty() ) { |
636 | qDebug(" Error: no arg"); | 640 | odebug << " Error: no arg" << oendl; |
637 | send( "500 Syntax error, command unrecognized" ); | 641 | send( "500 Syntax error, command unrecognized" ); |
@@ -675,3 +679,3 @@ void ServerPI::process( const QString& message ) | |||
675 | if ( !duproc.exec(in, out) ) { | 679 | if ( !duproc.exec(in, out) ) { |
676 | qDebug("du process failed; just sending back 1K"); | 680 | odebug << "du process failed; just sending back 1K" << oendl; |
677 | send( "213 1024"); | 681 | send( "213 1024"); |
@@ -683,3 +687,3 @@ void ServerPI::process( const QString& message ) | |||
683 | guess *= 1000; | 687 | guess *= 1000; |
684 | qDebug("sending back gzip guess of %d", guess); | 688 | odebug << "sending back gzip guess of " << guess << "" << oendl; |
685 | send( "213 " + QString::number(guess) ); | 689 | send( "213 " + QString::number(guess) ); |
@@ -738,4 +742,4 @@ bool ServerPI::backupRestoreGzip( const QString &file, QStringList &targets ) | |||
738 | targets = info.dirPath( TRUE ); | 742 | targets = info.dirPath( TRUE ); |
739 | qDebug("ServerPI::backupRestoreGzip for %s = %s", file.latin1(), | 743 | odebug << "ServerPI::backupRestoreGzip for " << file.latin1() << " = " |
740 | targets.join(" ").latin1() ); | 744 | << targets.join(" ").latin1() << oendl; |
741 | return true; | 745 | return true; |
@@ -986,3 +990,3 @@ void ServerPI::newConnection( int socket ) | |||
986 | { | 990 | { |
987 | //qDebug( "New incomming connection" ); | 991 | //odebug << "New incomming connection" << oendl; |
988 | 992 | ||
@@ -1000,3 +1004,3 @@ void ServerPI::newConnection( int socket ) | |||
1000 | else if ( wait[RetrieveFile] ) { | 1004 | else if ( wait[RetrieveFile] ) { |
1001 | qDebug("check retrieve file"); | 1005 | odebug << "check retrieve file" << oendl; |
1002 | if ( backupRestoreGzip( waitfile ) ) | 1006 | if ( backupRestoreGzip( waitfile ) ) |
@@ -1012,3 +1016,3 @@ void ServerPI::newConnection( int socket ) | |||
1012 | else if ( wait[RetrieveByteArray] ) { | 1016 | else if ( wait[RetrieveByteArray] ) { |
1013 | qDebug("retrieve byte array"); | 1017 | odebug << "retrieve byte array" << oendl; |
1014 | dtp->retrieveByteArray(); | 1018 | dtp->retrieveByteArray(); |
@@ -1077,3 +1081,3 @@ void ServerDTP::extractTarDone() | |||
1077 | { | 1081 | { |
1078 | qDebug("extract done"); | 1082 | odebug << "extract done" << oendl; |
1079 | #ifndef QT_NO_COP | 1083 | #ifndef QT_NO_COP |
@@ -1096,3 +1100,3 @@ void ServerDTP::connected() | |||
1096 | 1100 | ||
1097 | //qDebug( "Debug: Sending file '%s'", file.name().latin1() ); | 1101 | //odebug << "Debug: Sending file '" << file.name() << "'" << oendl; |
1098 | 1102 | ||
@@ -1118,3 +1122,3 @@ void ServerDTP::connected() | |||
1118 | // SHOULDN'T GET HERE, BUT DOING A SAFETY CHECK ANYWAY | 1122 | // SHOULDN'T GET HERE, BUT DOING A SAFETY CHECK ANYWAY |
1119 | qWarning("Previous tar --gzip process is still running; killing it..."); | 1123 | owarn << "Previous tar --gzip process is still running; killing it..." << oendl; |
1120 | createTargzProc->kill(); | 1124 | createTargzProc->kill(); |
@@ -1123,3 +1127,3 @@ void ServerDTP::connected() | |||
1123 | bytes_written = 0; | 1127 | bytes_written = 0; |
1124 | qDebug("==>start send tar process"); | 1128 | odebug << "==>start send tar process" << oendl; |
1125 | if ( !createTargzProc->start(Opie::Core::OProcess::NotifyOnExit, Opie::Core::OProcess::Stdout) ) | 1129 | if ( !createTargzProc->start(Opie::Core::OProcess::NotifyOnExit, Opie::Core::OProcess::Stdout) ) |
@@ -1136,3 +1140,3 @@ void ServerDTP::connected() | |||
1136 | 1140 | ||
1137 | // qDebug( "Debug: Sending byte array" ); | 1141 | // odebug << "Debug: Sending byte array" << oendl; |
1138 | bytes_written = 0; | 1142 | bytes_written = 0; |
@@ -1155,6 +1159,6 @@ void ServerDTP::connected() | |||
1155 | } | 1159 | } |
1156 | // qDebug( "Debug: Retrieving file %s", file.name().latin1() ); | 1160 | // odebug << "Debug: Retrieving file " << file.name() << "" << oendl; |
1157 | break; | 1161 | break; |
1158 | case RetrieveGzipFile: | 1162 | case RetrieveGzipFile: |
1159 | qDebug("=-> starting tar process to receive .tgz file"); | 1163 | odebug << "=-> starting tar process to receive .tgz file" << oendl; |
1160 | break; | 1164 | break; |
@@ -1167,6 +1171,6 @@ void ServerDTP::connected() | |||
1167 | } | 1171 | } |
1168 | // qDebug( "Debug: Retrieving byte array" ); | 1172 | // odebug << "Debug: Retrieving byte array" << oendl; |
1169 | break; | 1173 | break; |
1170 | case Idle: | 1174 | case Idle: |
1171 | qDebug("connection established but mode set to Idle; BUG!"); | 1175 | odebug << "connection established but mode set to Idle; BUG!" << oendl; |
1172 | break; | 1176 | break; |
@@ -1177,3 +1181,3 @@ void ServerDTP::connectionClosed() | |||
1177 | { | 1181 | { |
1178 | //qDebug( "Debug: Data connection closed %ld bytes written", bytes_written ); | 1182 | //odebug << "Debug: Data connection closed " << bytes_written << " bytes written" << oendl; |
1179 | 1183 | ||
@@ -1202,3 +1206,3 @@ void ServerDTP::connectionClosed() | |||
1202 | else if ( RetrieveGzipFile == mode ) { | 1206 | else if ( RetrieveGzipFile == mode ) { |
1203 | qDebug("Done writing ungzip file; closing input"); | 1207 | odebug << "Done writing ungzip file; closing input" << oendl; |
1204 | gzipProc->flushStdin(); | 1208 | gzipProc->flushStdin(); |
@@ -1224,3 +1228,3 @@ void ServerDTP::bytesWritten( int bytes ) | |||
1224 | if ( bytes_written == file.size() ) { | 1228 | if ( bytes_written == file.size() ) { |
1225 | // qDebug( "Debug: Sending complete: %d bytes", file.size() ); | 1229 | // odebug << "Debug: Sending complete: " << file.size() << " bytes" << oendl; |
1226 | file.close(); | 1230 | file.close(); |
@@ -1241,3 +1245,3 @@ void ServerDTP::bytesWritten( int bytes ) | |||
1241 | if ( bytes_written == buf.size() ) { | 1245 | if ( bytes_written == buf.size() ) { |
1242 | // qDebug( "Debug: Sending complete: %d bytes", buf.size() ); | 1246 | // odebug << "Debug: Sending complete: " << buf.size() << " bytes" << oendl; |
1243 | emit completed(); | 1247 | emit completed(); |
@@ -1265,3 +1269,3 @@ void ServerDTP::readyRead() | |||
1265 | gzipProc->writeStdin( s.data(), s.size() ); | 1269 | gzipProc->writeStdin( s.data(), s.size() ); |
1266 | qDebug("wrote %d bytes to ungzip ", s.size() ); | 1270 | odebug << "wrote " << s.size() << " bytes to ungzip " << oendl; |
1267 | } | 1271 | } |
@@ -1279,5 +1283,5 @@ void ServerDTP::writeTargzBlock(Opie::Core::OProcess *, char *buffer, int buflen | |||
1279 | writeBlock( buffer, buflen ); | 1283 | writeBlock( buffer, buflen ); |
1280 | qDebug("writeTargzBlock %d", buflen); | 1284 | odebug << "writeTargzBlock " << buflen << "" << oendl; |
1281 | if ( !createTargzProc->isRunning() ) { | 1285 | if ( !createTargzProc->isRunning() ) { |
1282 | qDebug("tar and gzip done"); | 1286 | odebug << "tar and gzip done" << oendl; |
1283 | emit completed(); | 1287 | emit completed(); |
@@ -1291,3 +1295,3 @@ void ServerDTP::targzDone() | |||
1291 | { | 1295 | { |
1292 | //qDebug("targz done"); | 1296 | //odebug << "targz done" << oendl; |
1293 | disconnect( createTargzProc, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), | 1297 | disconnect( createTargzProc, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), |
@@ -1299,5 +1303,5 @@ void ServerDTP::gzipTarBlock(Opie::Core::OProcess *, char *buffer, int buflen) | |||
1299 | { | 1303 | { |
1300 | //qDebug("gzipTarBlock"); | 1304 | //odebug << "gzipTarBlock" << oendl; |
1301 | if ( !gzipProc->isRunning() ) { | 1305 | if ( !gzipProc->isRunning() ) { |
1302 | //qDebug("auto start gzip proc"); | 1306 | //odebug << "auto start gzip proc" << oendl; |
1303 | gzipProc->start(Opie::Core::OProcess::NotifyOnExit, (Opie::Core::OProcess::Communication) ( Opie::Core::OProcess::Stdin | Opie::Core::OProcess::Stdout )); | 1307 | gzipProc->start(Opie::Core::OProcess::NotifyOnExit, (Opie::Core::OProcess::Communication) ( Opie::Core::OProcess::Stdin | Opie::Core::OProcess::Stdout )); |
@@ -1337,3 +1341,3 @@ void ServerDTP::sendGzipFile( const QString &fn, | |||
1337 | args += archiveTargets; | 1341 | args += archiveTargets; |
1338 | qDebug("sendGzipFile %s", args.join(" ").latin1() ); | 1342 | odebug << "sendGzipFile " << args.join(" ") << "" << oendl; |
1339 | createTargzProc->clearArguments( ); | 1343 | createTargzProc->clearArguments( ); |
@@ -1351,3 +1355,3 @@ void ServerDTP::gunzipDone() | |||
1351 | { | 1355 | { |
1352 | qDebug("gunzipDone"); | 1356 | odebug << "gunzipDone" << oendl; |
1353 | disconnect( gzipProc, SIGNAL( processExited() ), | 1357 | disconnect( gzipProc, SIGNAL( processExited() ), |
@@ -1361,7 +1365,7 @@ void ServerDTP::tarExtractBlock(Opie::Core::OProcess *, char *buffer, int buflen | |||
1361 | { | 1365 | { |
1362 | qDebug("tarExtractBlock"); | 1366 | odebug << "tarExtractBlock" << oendl; |
1363 | if ( !retrieveTargzProc->isRunning() ) { | 1367 | if ( !retrieveTargzProc->isRunning() ) { |
1364 | qDebug("auto start ungzip proc"); | 1368 | odebug << "auto start ungzip proc" << oendl; |
1365 | if ( !retrieveTargzProc->start(Opie::Core::OProcess::NotifyOnExit, Opie::Core::OProcess::Stdin) ) | 1369 | if ( !retrieveTargzProc->start(Opie::Core::OProcess::NotifyOnExit, Opie::Core::OProcess::Stdin) ) |
1366 | qWarning(" failed to start tar -x process"); | 1370 | owarn << " failed to start tar -x process" << oendl; |
1367 | } | 1371 | } |
@@ -1386,3 +1390,3 @@ void ServerDTP::retrieveGzipFile( const QString &fn ) | |||
1386 | { | 1390 | { |
1387 | qDebug("retrieveGzipFile %s", fn.latin1()); | 1391 | odebug << "retrieveGzipFile " << fn << "" << oendl; |
1388 | file.setName( fn ); | 1392 | file.setName( fn ); |