mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-20 18:32:09 +00:00
Use TLS for DO only if TLS_DISTRIBUTED_OBJECTS is defined
This commit is contained in:
parent
1a5c17b3f3
commit
87d50ff667
3 changed files with 14 additions and 27 deletions
|
@ -1,3 +1,9 @@
|
|||
2021-09-13 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* EcProcess.m:
|
||||
* EcTest.m:
|
||||
Use TLS for DO only if TLS_DISTRIBUTED_OBJECTS is defined.
|
||||
|
||||
2021-09-03 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* EcCommand.m: When deleting old logs, consider directories from all
|
||||
|
|
|
@ -3166,7 +3166,7 @@ NSLog(@"Ignored attempt to set timer interval to %g ... using 10.0", interval);
|
|||
{
|
||||
if (nil == ecLock)
|
||||
{
|
||||
#if GS_USE_GNUTLS
|
||||
#if GS_USE_GNUTLS && defined(TLS_DISTRIBTED_OBJECTS)
|
||||
/* Enable encrypted DO if supported by the base library.
|
||||
*/
|
||||
if ([NSSocketPort respondsToSelector: @selector(setClientOptionsForTLS:)])
|
||||
|
|
33
EcTest.m
33
EcTest.m
|
@ -41,24 +41,6 @@
|
|||
#import "EcHost.h"
|
||||
#import "EcTest.h"
|
||||
|
||||
static void
|
||||
setup()
|
||||
{
|
||||
static BOOL beenHere = NO;
|
||||
|
||||
if (NO == beenHere)
|
||||
{
|
||||
beenHere = YES;
|
||||
/* Enable encrypted DO if supported bu the base library.
|
||||
*/
|
||||
if ([NSSocketPort respondsToSelector: @selector(setClientOptionsForTLS:)])
|
||||
{
|
||||
[NSSocketPort performSelector: @selector(setClientOptionsForTLS:)
|
||||
withObject: [NSDictionary dictionary]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static NSUserDefaults*
|
||||
defaults()
|
||||
{
|
||||
|
@ -69,8 +51,6 @@ defaults()
|
|||
NSString *pref;
|
||||
NSDictionary *dict;
|
||||
|
||||
[EcProcess class]; // Force linker to provide library
|
||||
|
||||
pref = EC_DEFAULTS_PREFIX;
|
||||
if (nil == pref)
|
||||
{
|
||||
|
@ -89,13 +69,14 @@ defaults()
|
|||
id<EcTest>
|
||||
EcTestConnect(NSString *name, NSString *host, NSTimeInterval timeout)
|
||||
{
|
||||
setup();
|
||||
CREATE_AUTORELEASE_POOL(pool);
|
||||
BOOL triedLaunching = NO;
|
||||
NSUserDefaults *defs = defaults();
|
||||
id<EcTest> proxy = nil;
|
||||
NSUserDefaults *defs;
|
||||
NSDate *when;
|
||||
|
||||
[EcProcess class];
|
||||
defs = defaults();
|
||||
if (nil == host) host = @"";
|
||||
if (timeout > 0)
|
||||
{
|
||||
|
@ -183,10 +164,10 @@ EcTestConnect(NSString *name, NSString *host, NSTimeInterval timeout)
|
|||
id
|
||||
EcTestGetConfig(id<EcTest> process, NSString *key)
|
||||
{
|
||||
setup();
|
||||
id val;
|
||||
|
||||
NSCAssert([key isKindOfClass: [NSString class]], NSInvalidArgumentException);
|
||||
[EcProcess class];
|
||||
val = [process ecTestConfigForKey: key];
|
||||
if (nil != val)
|
||||
{
|
||||
|
@ -202,8 +183,8 @@ EcTestGetConfig(id<EcTest> process, NSString *key)
|
|||
void
|
||||
EcTestSetConfig(id<EcTest> process, NSString *key, id value)
|
||||
{
|
||||
setup();
|
||||
NSCAssert([key isKindOfClass: [NSString class]], NSInvalidArgumentException);
|
||||
[EcProcess class];
|
||||
if (nil != value)
|
||||
{
|
||||
value = [NSPropertyListSerialization
|
||||
|
@ -218,11 +199,11 @@ EcTestSetConfig(id<EcTest> process, NSString *key, id value)
|
|||
BOOL
|
||||
EcTestShutdown(id<EcTest> process, NSTimeInterval timeout)
|
||||
{
|
||||
setup();
|
||||
int pid;
|
||||
NSConnection *conn;
|
||||
NSDate *when;
|
||||
|
||||
[EcProcess class];
|
||||
conn = [(NSDistantObject*)process connectionForProxy];
|
||||
if (NO == [conn isValid])
|
||||
{
|
||||
|
@ -266,7 +247,6 @@ EcTestShutdown(id<EcTest> process, NSTimeInterval timeout)
|
|||
BOOL
|
||||
EcTestShutdownByName(NSString *name, NSString *host, NSTimeInterval timeout)
|
||||
{
|
||||
setup();
|
||||
NSPortNameServer *ns;
|
||||
NSPort *port;
|
||||
id<EcTest> proxy = nil;
|
||||
|
@ -274,6 +254,7 @@ EcTestShutdownByName(NSString *name, NSString *host, NSTimeInterval timeout)
|
|||
NSDate *when;
|
||||
int pid;
|
||||
|
||||
[EcProcess class];
|
||||
if (nil == host) host = @"";
|
||||
if (timeout > 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue