summaryrefslogtreecommitdiff
authorzecke <zecke>2003-11-21 09:37:54 (UTC)
committer zecke <zecke>2003-11-21 09:37:54 (UTC)
commit10ae99b2cbbf3e24f3568367a85b3b2d6c0fa289 (patch) (unidiff)
treeac9c821ddeef8d6e05024206e19b7dc780791611
parent99ecb210f893437068060194b031cb37b94a0398 (diff)
downloadopie-10ae99b2cbbf3e24f3568367a85b3b2d6c0fa289.zip
opie-10ae99b2cbbf3e24f3568367a85b3b2d6c0fa289.tar.gz
opie-10ae99b2cbbf3e24f3568367a85b3b2d6c0fa289.tar.bz2
Fix bug 1219.
If not authorized no dtp is created so 0x000000000->close is likely to fail. lpotter something I think Qtopia suffers from as well
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/transferserver.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index eea9f3a..9519d11 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -332,33 +332,35 @@ ServerPI::ServerPI( int socket, QObject *parent, const char* name )
332 directory = QDir::currentDirPath(); 332 directory = QDir::currentDirPath();
333 333
334 static int p = 1024; 334 static int p = 1024;
335 335
336 while ( !serversocket || !serversocket->ok() ) { 336 while ( !serversocket || !serversocket->ok() ) {
337 delete serversocket; 337 delete serversocket;
338 serversocket = new ServerSocket( ++p, this ); 338 serversocket = new ServerSocket( ++p, this );
339 } 339 }
340 connect( serversocket, SIGNAL( newIncomming( int ) ), 340 connect( serversocket, SIGNAL( newIncomming( int ) ),
341 SLOT( newConnection( int ) ) ); 341 SLOT( newConnection( int ) ) );
342 } 342 }
343} 343}
344 344
345ServerPI::~ServerPI() 345ServerPI::~ServerPI()
346{ 346{
347 close(); 347 close();
348 dtp->close(); 348
349 if ( dtp )
350 dtp->close();
349 delete dtp; 351 delete dtp;
350 delete serversocket; 352 delete serversocket;
351} 353}
352 354
353bool ServerPI::verifyAuthorised() 355bool ServerPI::verifyAuthorised()
354{ 356{
355 if ( !SyncAuthentication::isAuthorized(peerAddress()) ) { 357 if ( !SyncAuthentication::isAuthorized(peerAddress()) ) {
356 state = Forbidden; 358 state = Forbidden;
357 return FALSE; 359 return FALSE;
358 } 360 }
359 return TRUE; 361 return TRUE;
360} 362}
361 363
362void ServerPI::connectionClosed() 364void ServerPI::connectionClosed()
363{ 365{
364 // qDebug( "Debug: Connection closed" ); 366 // qDebug( "Debug: Connection closed" );