Browse Source

Merge branch 'master' of https://kolja-strohm693.visualstudio.com/DefaultCollection/_git/Chat%20Server

Kolja Strohm 6 years ago
parent
commit
51508c1b17
2 changed files with 28 additions and 24 deletions
  1. 24 24
      ChatServer/ChatServer.cpp
  2. 4 0
      ChatServer/main.cpp

+ 24 - 24
ChatServer/ChatServer.cpp

@@ -416,14 +416,14 @@ void CSAKlient::thread()
 				if( 1 )
 				{
 					klient->sendeEncrypted( "\1", 1 );
-					char nLen = 0;
-					klient->getNachrichtEncrypted( &nLen, 1 );
+					unsigned char nLen = 0;
+					klient->getNachrichtEncrypted( (char*)&nLen, 1 );
 					char *n = new char[ nLen + 1 ];
 					n[ (int)nLen ] = 0;
 					if( nLen )
 						klient->getNachrichtEncrypted( n, nLen );
-					char pLen = 0;
-					klient->getNachrichtEncrypted( &pLen, 1 );
+                    unsigned char pLen = 0;
+					klient->getNachrichtEncrypted( (char*)&pLen, 1 );
 					char *p = new char[ pLen + 1 ];
 					p[ (int)pLen ] = 0;
 					if( pLen )
@@ -887,11 +887,11 @@ void CSKlient::thread()
 							klient->sendeEncrypted( "\1", 1 );
 							int vonAcc = 0;
 							int zuAcc = 0;
-							char len = 0;
+							unsigned char len = 0;
 							char *nachricht = 0;
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&vonAcc, 4 ) );
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&zuAcc, 4 ) );
-							res = (char)( res & (char)klient->getNachrichtEncrypted( &len, 1 ) );
+							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&len, 1 ) );
 							if( len )
 							{
 								nachricht = new char[ len + 1 ];
@@ -929,11 +929,11 @@ void CSKlient::thread()
 							klient->sendeEncrypted( "\1", 1 );
 							int accId = 0;
 							int freundId = 0;
-							char len = 0;
+							unsigned char len = 0;
 							char *status = 0;
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&accId, 4 ) );
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&freundId, 4 ) );
-							res = (char)( res & (char)klient->getNachrichtEncrypted( &len, 1 ) );
+							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&len, 1 ) );
 							if( len )
 							{
 								status = new char[ len + 1 ];
@@ -954,11 +954,11 @@ void CSKlient::thread()
 							klient->sendeEncrypted( "\1", 1 );
 							int accId = 0;
 							int freundId = 0;
-							char len = 0;
+							unsigned char len = 0;
 							char *name = 0;
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&accId, 4 ) );
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&freundId, 4 ) );
-							res = (char)( res & (char)klient->getNachrichtEncrypted( &len, 1 ) );
+							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&len, 1 ) );
 							if( len )
 							{
 								name = new char[ len + 1 ];
@@ -1059,12 +1059,12 @@ void CSKlient::thread()
 							int vonAcc = 0;
 							int zuAcc = 0;
 							int chatroomId = 0;
-							char len = 0;
+							unsigned char len = 0;
 							char *nachricht = 0;
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&vonAcc, 4 ) );
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&zuAcc, 4 ) );
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&chatroomId, 4 ) );
-							res = (char)( res & (char)klient->getNachrichtEncrypted( &len, 1 ) );
+							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&len, 1 ) );
 							if( len )
 							{
 								nachricht = new char[ len + 1 ];
@@ -1133,10 +1133,10 @@ void CSKlient::thread()
 						{
 							klient->sendeEncrypted( "\1", 1 );
 							int zuAcc = 0;
-							char len = 0;
+							unsigned char len = 0;
 							char *nachricht = 0;
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&zuAcc, 4 ) );
-							res = (char)( res & (char)klient->getNachrichtEncrypted( &len, 1 ) );
+							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&len, 1 ) );
 							if( len )
 							{
 								nachricht = new char[ len + 1 ];
@@ -1266,10 +1266,10 @@ void CSKlient::thread()
 							klient->sendeEncrypted( "\1", 1 );
 							int zuAcc = 0;
 							int gruppeId = 0;
-							char len;
+							unsigned char len;
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&zuAcc, 4 ) );
 							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&gruppeId, 4 ) );
-							res = (char)( res & (char)klient->getNachrichtEncrypted( &len, 1 ) );
+							res = (char)( res & (char)klient->getNachrichtEncrypted( (char*)&len, 1 ) );
 							char *nachricht = new char[ len + 1 ];
 							nachricht[ (int)len ] = 0;
 							if( len )
@@ -1405,10 +1405,10 @@ void CSKlient::thread()
 					}
 					klient->sendeEncrypted( "\1", 1 );
 					int zuAccount = 0;
-					char len = 0;
+					unsigned char len = 0;
 					char *nachricht = 0;
 					klient->getNachrichtEncrypted( (char*)&zuAccount, 4 );
-					klient->getNachrichtEncrypted( &len, 1 );
+					klient->getNachrichtEncrypted( (char*)&len, 1 );
 					if( len )
 					{
 						nachricht = new char[ len + 1 ];
@@ -1439,9 +1439,9 @@ void CSKlient::thread()
 						break;
 					}
 					klient->sendeEncrypted( "\1", 1 );
-					char len;
+					unsigned char len;
 					char *name;
-					klient->getNachrichtEncrypted( &len, 1 );
+					klient->getNachrichtEncrypted( (char*)&len, 1 );
 					if( len )
 					{
 						name = new char[ len + 1 ];
@@ -1586,9 +1586,9 @@ void CSKlient::thread()
 						break;
 					}
 					klient->sendeEncrypted( "\1", 1 );
-					char nLen = 0;
+					unsigned char nLen = 0;
 					char *name = 0;
-					klient->getNachrichtEncrypted( &nLen, 1 );
+					klient->getNachrichtEncrypted( (char*)&nLen, 1 );
 					if( nLen )
 					{
 						name = new char[ nLen + 1 ];
@@ -1737,10 +1737,10 @@ void CSKlient::thread()
 					}
 					klient->sendeEncrypted( "\1", 1 );
 					int chatroomId = 0;
-					char len = 0;
+					unsigned char len = 0;
 					char *nachricht = 0;
 					klient->getNachrichtEncrypted( (char*)&chatroomId, 4 );
-					klient->getNachrichtEncrypted( &len, 1 );
+					klient->getNachrichtEncrypted( (char*)&len, 1 );
 					if( len )
 					{
 						nachricht = new char[ len + 1 ];

+ 4 - 0
ChatServer/main.cpp

@@ -3,9 +3,13 @@
 #include <iostream>
 #include <fstream>
 #include <Globals.h>
+#include <sys/resource.h>
 
 int main()
 {
+	struct rlimit core_limits;
+	core_limits.rlim_cur = core_limits.rlim_max = RLIM_INFINITY;
+	setrlimit(RLIMIT_CORE, &core_limits);
 #ifdef DEBUG
     //chdir( "/ksg/Server/chat" );
 #endif