Browse Source

Fehler durch unverschlüsselte Clients behoben

Kolja Strohm 6 years ago
parent
commit
772a4d596a
1 changed files with 9 additions and 9 deletions
  1. 9 9
      MainServer/MainServer.cpp

+ 9 - 9
MainServer/MainServer.cpp

@@ -19,9 +19,9 @@ MainServer::MainServer( InitDatei *zDat )
 	gesendet = 0;
 	gesendet = 0;
 	dat = zDat->getThis();
 	dat = zDat->getThis();
     serverSSL = new SSLServer();
     serverSSL = new SSLServer();
-    aServer->setPrivateKeyPassword( zDat->zWert( "SSLPasswort" )->getText() );
-    aServer->setCertificateFile( zDat->zWert( "SSLCert" )->getText() );
-    aServer->setPrivateKeyFile( zDat->zWert( "SSLKey" )->getText() );
+    serverSSL->setPrivateKeyPassword( zDat->zWert( "SSLPasswort" )->getText() );
+    serverSSL->setCertificateFile( zDat->zWert( "SSLCert" )->getText() );
+    serverSSL->setPrivateKeyFile( zDat->zWert( "SSLKey" )->getText() );
 	server = new Server();
 	server = new Server();
 	aServer = new SSLServer();
 	aServer = new SSLServer();
     aServer->setPrivateKeyPassword( zDat->zWert( "SSLPasswort" )->getText() );
     aServer->setPrivateKeyPassword( zDat->zWert( "SSLPasswort" )->getText() );
@@ -59,7 +59,7 @@ MainServer::~MainServer()
 // nicht constant 
 // nicht constant 
 void MainServer::runn()
 void MainServer::runn()
 {
 {
-	while( !end )
+	while( !end && aServer->isConnected() )
 	{
 	{
 		SSLSKlient *klient;
 		SSLSKlient *klient;
 		klient = aServer->getKlient();
 		klient = aServer->getKlient();
@@ -71,7 +71,7 @@ void MainServer::runn()
 			return;
 			return;
 		}
 		}
 		if( !klient )
 		if( !klient )
-			return;
+			continue;
 		MSAKlient *clHandle = new MSAKlient( klient, getThis() );
 		MSAKlient *clHandle = new MSAKlient( klient, getThis() );
 		clHandle->start();
 		clHandle->start();
 	}
 	}
@@ -84,23 +84,23 @@ void MainServer::thread()
     MainServer *ms = this;
     MainServer *ms = this;
     AsynchronCall( [ sslServer, cl, ms ]()
     AsynchronCall( [ sslServer, cl, ms ]()
     {
     {
-        while( 1 )
+        while( sslServer->isConnected() )
         {
         {
             SSLSKlient *klient = sslServer->getKlient();
             SSLSKlient *klient = sslServer->getKlient();
             if( !klient )
             if( !klient )
-                break;
+                continue;
             Framework::getThreadRegister()->cleanUpClosedThreads();
             Framework::getThreadRegister()->cleanUpClosedThreads();
             MSKlientSSL *clHandle = new MSKlientSSL( klient, ms->getThis() );
             MSKlientSSL *clHandle = new MSKlientSSL( klient, ms->getThis() );
             clHandle->start();
             clHandle->start();
             (*cl)++;
             (*cl)++;
         }
         }
     } );
     } );
-	while( 1 )
+	while( server->isConnected() )
 	{
 	{
 		SKlient *klient;
 		SKlient *klient;
 		klient = server->getKlient();
 		klient = server->getKlient();
 		if( !klient )
 		if( !klient )
-			break;
+			continue;
 		Framework::getThreadRegister()->cleanUpClosedThreads();
 		Framework::getThreadRegister()->cleanUpClosedThreads();
 		MSKlient *clHandle = new MSKlient( klient, getThis() );
 		MSKlient *clHandle = new MSKlient( klient, getThis() );
 		clHandle->start();
 		clHandle->start();