"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/portablereflectclient.cpp" between
muscle8.20.zip and muscle8.30.zip

About: MUSCLE (Multi User Server Client Linking Environment) is a messaging server and networking API. The included server program ("muscled") lets its clients message each other, and/or store information in its serverside hierarchical database.

portablereflectclient.cpp  (muscle8.20):portablereflectclient.cpp  (muscle8.30)
skipping to change at line 44 skipping to change at line 44
String hostName; String hostName;
uint16 port = 2960; uint16 port = 2960;
if (argc > 1) ParseConnectArg(argv[1], hostName, port, false); if (argc > 1) ParseConnectArg(argv[1], hostName, port, false);
ConstSocketRef sock = Connect(hostName(), port, "portablereflectclient", fals e); ConstSocketRef sock = Connect(hostName(), port, "portablereflectclient", fals e);
if (sock() == NULL) return 10; if (sock() == NULL) return 10;
// We'll receive plain text over stdin // We'll receive plain text over stdin
StdinDataIO stdinIO(false); StdinDataIO stdinIO(false);
PlainTextMessageIOGateway stdinGateway; PlainTextMessageIOGateway stdinGateway;
stdinGateway.SetDataIO(DataIORef(&stdinIO, false)); stdinGateway.SetDataIO(DummyDataIORef(stdinIO));
// And send and receive flattened Message objects over our TCP socket // And send and receive flattened Message objects over our TCP socket
TCPSocketDataIO tcpIO(sock, false); TCPSocketDataIO tcpIO(sock, false);
#ifdef MUSCLE_USE_TEMPLATING_MESSAGE_IO_GATEWAY_BY_DEFAULT #ifdef MUSCLE_USE_TEMPLATING_MESSAGE_IO_GATEWAY_BY_DEFAULT
TemplatingMessageIOGateway tcpGateway; TemplatingMessageIOGateway tcpGateway;
#else #else
MessageIOGateway tcpGateway; MessageIOGateway tcpGateway;
#endif #endif
tcpGateway.SetDataIO(DataIORef(&tcpIO, false)); tcpGateway.SetDataIO(DummyDataIORef(tcpIO));
DataIORef networkIORef(&tcpIO, false); DummyDataIORef networkIORef(tcpIO);
AbstractMessageIOGatewayRef gatewayRef(&tcpGateway, false); DummyAbstractMessageIOGatewayRef gatewayRef(tcpGateway);
status_t ret;
#ifdef MUSCLE_ENABLE_SSL #ifdef MUSCLE_ENABLE_SSL
const char * publicKeyPath = NULL; const char * publicKeyPath = NULL;
const char * privateKeyPath = NULL; const char * privateKeyPath = NULL;
for (int i=1; i<argc; i++) for (int i=1; i<argc; i++)
{ {
const char * a = argv[i]; const char * a = argv[i];
if (strncmp(a, "publickey=", 10) == 0) publicKeyPath = a+10; if (strncmp(a, "publickey=", 10) == 0) publicKeyPath = a+10;
else if (strncmp(a, "privatekey=", 11) == 0) privateKeyPath = a+11; else if (strncmp(a, "privatekey=", 11) == 0) privateKeyPath = a+11;
} }
if ((privateKeyPath)&&(publicKeyPath == NULL)) publicKeyPath = privateKeyPath ; // grab public key from private-key-file if ((privateKeyPath)&&(publicKeyPath == NULL)) publicKeyPath = privateKeyPath ; // grab public key from private-key-file
if ((publicKeyPath)||(privateKeyPath)) if ((publicKeyPath)||(privateKeyPath))
{ {
SSLSocketDataIORef sslIORef(new SSLSocketDataIO(sock, false, false)); SSLSocketDataIORef sslIORef(new SSLSocketDataIO(sock, false, false));
if (publicKeyPath) if (publicKeyPath)
{ {
status_t ret;
if (sslIORef()->SetPublicKeyCertificate(publicKeyPath).IsOK(ret)) if (sslIORef()->SetPublicKeyCertificate(publicKeyPath).IsOK(ret))
{ {
LogTime(MUSCLE_LOG_INFO, "Using public key certificate file [%s] to connect to server\n", publicKeyPath); LogTime(MUSCLE_LOG_INFO, "Using public key certificate file [%s] to connect to server\n", publicKeyPath);
} }
else else
{ {
LogTime(MUSCLE_LOG_CRITICALERROR, "Couldn't load public key certific ate file [%s] [%s]\n", publicKeyPath, ret()); LogTime(MUSCLE_LOG_CRITICALERROR, "Couldn't load public key certific ate file [%s] [%s]\n", publicKeyPath, ret());
return 10; return 10;
} }
} }
skipping to change at line 196 skipping to change at line 195
if (arg1) ref()->AddMessage(arg1, uploadMsg); if (arg1) ref()->AddMessage(arg1, uploadMsg);
} }
break; break;
case 'c': case 'C': case 'c': case 'C':
{ {
// Set the same node multiple times in rapid succession, // Set the same node multiple times in rapid succession,
// to test the results of the SETDATANODE_FLAG_ENABLESUPERCEDE flag // to test the results of the SETDATANODE_FLAG_ENABLESUPERCEDE flag
const bool enableSupercede = (text[0] == 'C'); const bool enableSupercede = (text[0] == 'C');
for (int i=0; i<10; i++) for (int j=0; j<10; j++)
{ {
ref = GetMessageFromPool(PR_COMMAND_SETDATA); ref = GetMessageFromPool(PR_COMMAND_SETDATA);
if (enableSupercede) ref()->AddFlat(PR_NAME_FLAGS, SetData NodeFlags(SETDATANODE_FLAG_ENABLESUPERCEDE)); if (enableSupercede) ref()->AddFlat(PR_NAME_FLAGS, SetData NodeFlags(SETDATANODE_FLAG_ENABLESUPERCEDE));
MessageRef subMsg = GetMessageFromPool(); MessageRef subMsg = GetMessageFromPool();
subMsg()->AddInt32(String("%1 counter").Arg(enableSupercede ?"Supercede":"Normal"), i); subMsg()->AddInt32(String("%1 counter").Arg(enableSupercede ?"Supercede":"Normal"), j);
ref()->AddMessage("test_node", subMsg); ref()->AddMessage("test_node", subMsg);
gatewayRef()->AddOutgoingMessage(ref); gatewayRef()->AddOutgoingMessage(ref);
} }
ref = GetMessageFromPool(PR_COMMAND_PING); // just so we can see when it's done ref = GetMessageFromPool(PR_COMMAND_PING); // just so we can see when it's done
} }
break; break;
case 'k': case 'k':
 End of changes. 6 change blocks. 
8 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)