Diffstat (limited to 'core/launcher/transferserver.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/launcher/transferserver.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp index 87a49eb..7294f9c 100644 --- a/core/launcher/transferserver.cpp +++ b/core/launcher/transferserver.cpp | |||
@@ -27,35 +27,35 @@ | |||
27 | #include <shadow.h> | 27 | #include <shadow.h> |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | #include <qdir.h> | 30 | #include <qdir.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qdatastream.h> | 33 | #include <qdatastream.h> |
34 | #include <qmessagebox.h> | 34 | #include <qmessagebox.h> |
35 | #include <qstringlist.h> | 35 | #include <qstringlist.h> |
36 | #include <qfileinfo.h> | 36 | #include <qfileinfo.h> |
37 | #include <qregexp.h> | 37 | #include <qregexp.h> |
38 | //#include <qpe/qcopchannel_qws.h> | 38 | //#include <qpe/qcopchannel_qws.h> |
39 | #include <qpe/qprocess.h> | ||
40 | #include <qpe/process.h> | 39 | #include <qpe/process.h> |
41 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 41 | #include <qpe/qcopenvelope_qws.h> |
43 | 42 | ||
44 | #include "transferserver.h" | 43 | #include "transferserver.h" |
44 | #include "qprocess.h" | ||
45 | 45 | ||
46 | const int block_size = 51200; | 46 | const int block_size = 51200; |
47 | 47 | ||
48 | TransferServer::TransferServer( Q_UINT16 port, QObject *parent = 0, | 48 | TransferServer::TransferServer( Q_UINT16 port, QObject *parent, |
49 | const char* name = 0) | 49 | const char* name ) |
50 | : QServerSocket( port, 1, parent, name ) | 50 | : QServerSocket( port, 1, parent, name ) |
51 | { | 51 | { |
52 | if ( !ok() ) | 52 | if ( !ok() ) |
53 | qWarning( "Failed to bind to port %d", port ); | 53 | qWarning( "Failed to bind to port %d", port ); |
54 | } | 54 | } |
55 | 55 | ||
56 | TransferServer::~TransferServer() | 56 | TransferServer::~TransferServer() |
57 | { | 57 | { |
58 | 58 | ||
59 | } | 59 | } |
60 | 60 | ||
61 | void TransferServer::newConnection( int socket ) | 61 | void TransferServer::newConnection( int socket ) |
@@ -72,25 +72,25 @@ bool accessAuthorized(QHostAddress peeraddress) | |||
72 | bool ok = (peeraddress.ip4Addr() & (((1<<auth_peer_bits)-1)<<(32-auth_peer_bits))) | 72 | bool ok = (peeraddress.ip4Addr() & (((1<<auth_peer_bits)-1)<<(32-auth_peer_bits))) |
73 | == auth_peer; | 73 | == auth_peer; |
74 | /* Allows denial-of-service attack. | 74 | /* Allows denial-of-service attack. |
75 | if ( !ok ) { | 75 | if ( !ok ) { |
76 | QMessageBox::warning(0,tr("Security"), | 76 | QMessageBox::warning(0,tr("Security"), |
77 | tr("<p>An attempt to access this device from %1 has been denied.") | 77 | tr("<p>An attempt to access this device from %1 has been denied.") |
78 | .arg(peeraddress.toString())); | 78 | .arg(peeraddress.toString())); |
79 | } | 79 | } |
80 | */ | 80 | */ |
81 | return ok; | 81 | return ok; |
82 | } | 82 | } |
83 | 83 | ||
84 | ServerPI::ServerPI( int socket, QObject *parent = 0, const char* name = 0 ) | 84 | ServerPI::ServerPI( int socket, QObject *parent, const char* name ) |
85 | : QSocket( parent, name ) , dtp( 0 ), serversocket( 0 ), waitsocket( 0 ) | 85 | : QSocket( parent, name ) , dtp( 0 ), serversocket( 0 ), waitsocket( 0 ) |
86 | { | 86 | { |
87 | state = Connected; | 87 | state = Connected; |
88 | 88 | ||
89 | setSocket( socket ); | 89 | setSocket( socket ); |
90 | 90 | ||
91 | peerport = peerPort(); | 91 | peerport = peerPort(); |
92 | peeraddress = peerAddress(); | 92 | peeraddress = peerAddress(); |
93 | 93 | ||
94 | #ifndef INSECURE | 94 | #ifndef INSECURE |
95 | if ( !accessAuthorized(peeraddress) ) { | 95 | if ( !accessAuthorized(peeraddress) ) { |
96 | state = Forbidden; | 96 | state = Forbidden; |
@@ -843,25 +843,25 @@ QString ServerPI::absFilePath( const QString& file ) | |||
843 | filepath = directory.path() + "/" + file; | 843 | filepath = directory.path() + "/" + file; |
844 | 844 | ||
845 | return filepath; | 845 | return filepath; |
846 | } | 846 | } |
847 | 847 | ||
848 | 848 | ||
849 | void ServerPI::timerEvent( QTimerEvent * ) | 849 | void ServerPI::timerEvent( QTimerEvent * ) |
850 | { | 850 | { |
851 | connectionClosed(); | 851 | connectionClosed(); |
852 | } | 852 | } |
853 | 853 | ||
854 | 854 | ||
855 | ServerDTP::ServerDTP( QObject *parent = 0, const char* name = 0) | 855 | ServerDTP::ServerDTP( QObject *parent, const char* name ) |
856 | : QSocket( parent, name ), mode( Idle ), createTargzProc( 0 ), | 856 | : QSocket( parent, name ), mode( Idle ), createTargzProc( 0 ), |
857 | retrieveTargzProc( 0 ), gzipProc( 0 ) | 857 | retrieveTargzProc( 0 ), gzipProc( 0 ) |
858 | { | 858 | { |
859 | 859 | ||
860 | connect( this, SIGNAL( connected() ), SLOT( connected() ) ); | 860 | connect( this, SIGNAL( connected() ), SLOT( connected() ) ); |
861 | connect( this, SIGNAL( connectionClosed() ), SLOT( connectionClosed() ) ); | 861 | connect( this, SIGNAL( connectionClosed() ), SLOT( connectionClosed() ) ); |
862 | connect( this, SIGNAL( bytesWritten( int ) ), SLOT( bytesWritten( int ) ) ); | 862 | connect( this, SIGNAL( bytesWritten( int ) ), SLOT( bytesWritten( int ) ) ); |
863 | connect( this, SIGNAL( readyRead() ), SLOT( readyRead() ) ); | 863 | connect( this, SIGNAL( readyRead() ), SLOT( readyRead() ) ); |
864 | 864 | ||
865 | gzipProc = new QProcess( this, "gzipProc" ); | 865 | gzipProc = new QProcess( this, "gzipProc" ); |
866 | gzipProc->setCommunication( QProcess::Stdin | QProcess::Stdout ); | 866 | gzipProc->setCommunication( QProcess::Stdin | QProcess::Stdout ); |
867 | 867 | ||