"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "server/muscled.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.

muscled.cpp  (muscle8.20):muscled.cpp  (muscle8.30)
skipping to change at line 275 skipping to change at line 275
{ {
MWARN_OUT_OF_MEMORY; MWARN_OUT_OF_MEMORY;
ret = B_OUT_OF_MEMORY; ret = B_OUT_OF_MEMORY;
} }
} }
} }
// Set up the Session Factory. This factory object creates the new StorageRe flectSessions // Set up the Session Factory. This factory object creates the new StorageRe flectSessions
// as needed when people connect, and also has a filter to keep out the riff- raff. // as needed when people connect, and also has a filter to keep out the riff- raff.
StorageReflectSessionFactory factory; factory.SetMaxIncomingMessageSize(maxMe ssageSize); StorageReflectSessionFactory factory; factory.SetMaxIncomingMessageSize(maxMe ssageSize);
FilterSessionFactory filter(ReflectSessionFactoryRef(&factory, false), maxSes sionsPerHost, maxSessions); FilterSessionFactory filter(DummyReflectSessionFactoryRef(factory), maxSessio nsPerHost, maxSessions);
filter.SetInputPolicy(inputPolicyRef); filter.SetInputPolicy(inputPolicyRef);
filter.SetOutputPolicy(outputPolicyRef); filter.SetOutputPolicy(outputPolicyRef);
for (int b=bans.GetNumItems()-1; ((ret.IsOK())&&(b>=0)); b--) ret |= filt er.PutBanPattern(bans[b]()); for (int b=bans.GetNumItems()-1; ((ret.IsOK())&&(b>=0)); b--) ret |= filt er.PutBanPattern(bans[b]());
for (int a=requires.GetNumItems()-1; ((ret.IsOK())&&(a>=0)); a--) ret |= filt er.PutRequirePattern(requires[a]()); for (int a=requires.GetNumItems()-1; ((ret.IsOK())&&(a>=0)); a--) ret |= filt er.PutRequirePattern(requires[a]());
ret |= LoadCryptoKey(false, args.GetStringPointer("privatekey"), server); ret |= LoadCryptoKey(false, args.GetStringPointer("privatekey"), server);
ret |= LoadCryptoKey(true, args.GetStringPointer("publickey"), server); ret |= LoadCryptoKey(true, args.GetStringPointer("publickey"), server);
// Set up ports. We allow multiple ports, mostly just to show how it can be done; // Set up ports. We allow multiple ports, mostly just to show how it can be done;
// they all get the same set of ban/require patterns (since they all do the s ame thing anyway). // they all get the same set of ban/require patterns (since they all do the s ame thing anyway).
if (listenPorts.IsEmpty()) listenPorts.PutWithDefault(IPAddressAndPort(invali dIP, DEFAULT_MUSCLED_PORT)); if (listenPorts.IsEmpty()) listenPorts.PutWithDefault(IPAddressAndPort(invali dIP, DEFAULT_MUSCLED_PORT));
for (HashtableIterator<IPAddressAndPort, Void> iter(listenPorts); iter.HasDat a(); iter++) for (HashtableIterator<IPAddressAndPort, Void> iter(listenPorts); iter.HasDat a(); iter++)
{ {
const IPAddressAndPort & iap = iter.GetKey(); const IPAddressAndPort & iap = iter.GetKey();
if (server.PutAcceptFactory(iap.GetPort(), ReflectSessionFactoryRef(&filte r, false), iap.GetIPAddress()).IsError(ret)) if (server.PutAcceptFactory(iap.GetPort(), DummyReflectSessionFactoryRef(f ilter), iap.GetIPAddress()).IsError(ret))
{ {
if (iap.GetIPAddress() == invalidIP) LogTime(MUSCLE_LOG_CRITICALERROR, "Error adding port %u, aborting. [%s]\n", iap.GetPort(), ret()); if (iap.GetIPAddress() == invalidIP) LogTime(MUSCLE_LOG_CRITICALERROR, "Error adding port %u, aborting. [%s]\n", iap.GetPort(), ret());
else LogTime(MUSCLE_LOG_CRITICALERROR, "Error adding port %u to interface %s, aborting. [%s]\n", iap.GetPort(), Inet_N toA(iap.GetIPAddress())(), ret()); else LogTime(MUSCLE_LOG_CRITICALERROR, "Error adding port %u to interface %s, aborting. [%s]\n", iap.GetPort(), Inet_N toA(iap.GetIPAddress())(), ret());
break; break;
} }
} }
if (ret.IsOK()) if (ret.IsOK())
{ {
retVal = server.ServerProcessLoop().IsOK(ret) ? 0 : 10; retVal = server.ServerProcessLoop().IsOK(ret) ? 0 : 10;
skipping to change at line 329 skipping to change at line 329
TCHECKPOINT; TCHECKPOINT;
#ifdef MUSCLE_ENABLE_MEMORY_TRACKING #ifdef MUSCLE_ENABLE_MEMORY_TRACKING
// Set up memory allocation policies for our server. These policies will mak e sure // Set up memory allocation policies for our server. These policies will mak e sure
// that the server can't allocate more than a specified amount of memory, and if it tries, // that the server can't allocate more than a specified amount of memory, and if it tries,
// some emergency callbacks will be called to free up cached info. // some emergency callbacks will be called to free up cached info.
FunctionCallback fcb(AbstractObjectRecycler::GlobalFlushAllCachedObjects); FunctionCallback fcb(AbstractObjectRecycler::GlobalFlushAllCachedObjects);
MemoryAllocatorRef nullRef; MemoryAllocatorRef nullRef;
AutoCleanupProxyMemoryAllocator cleanupAllocator(nullRef); AutoCleanupProxyMemoryAllocator cleanupAllocator(nullRef);
cleanupAllocator.GetCallbacksQueue().AddTail(GenericCallbackRef(&fcb, false)) ; cleanupAllocator.GetCallbacksQueue().AddTail(DummyGenericCallbackRef(fcb));
UsageLimitProxyMemoryAllocator usageLimitAllocator(MemoryAllocatorRef(&cleanu pAllocator, false)); UsageLimitProxyMemoryAllocator usageLimitAllocator(DummyMemoryAllocatorRef(cl eanupAllocator));
SetCPlusPlusGlobalMemoryAllocator(MemoryAllocatorRef(&usageLimitAllocator, fa lse)); SetCPlusPlusGlobalMemoryAllocator(DummyMemoryAllocatorRef(usageLimitAllocator ));
const int ret = muscledmainAux(argc, argv, &usageLimitAllocator); const int ret = muscledmainAux(argc, argv, &usageLimitAllocator);
SetCPlusPlusGlobalMemoryAllocator(MemoryAllocatorRef()); // unset, so that n one of our allocator objects will be used after they are gone SetCPlusPlusGlobalMemoryAllocator(MemoryAllocatorRef()); // unset, so that n one of our allocator objects will be used after they are gone
return ret; return ret;
#else #else
// Without memory-allocation rules, things are much simpler :^) // Without memory-allocation rules, things are much simpler :^)
return muscledmainAux(argc, argv, NULL); return muscledmainAux(argc, argv, NULL);
#endif #endif
} }
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

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