Author: wlux
Date: Sun Dec 28 12:59:36 2014
New Revision: 38265

URL: http://svn.gna.org/viewcvs/gnustep?rev=38265&view=rev
Log:
Fixes to build again when tls is disabled

Modified:
    libs/base/trunk/ChangeLog
    libs/base/trunk/Source/GSSocketStream.m
    libs/base/trunk/Source/GSTLS.m

Modified: libs/base/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=38265&r1=38264&r2=38265&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog   (original)
+++ libs/base/trunk/ChangeLog   Sun Dec 28 12:59:36 2014
@@ -1,3 +1,10 @@
+2014-12-28  Wolfgang Lux  <[email protected]>
+
+       * Source/GSSocketStream.m: Add necessary GSTLSHandler methods when
+       TLS is disabled.
+       * Source/GSTLS.m (standardizedPath): Define private function only
+       when TLS is enabled.
+
 2014-12-23  Richard Frith-Macdonald <[email protected]>
 
        * Source/NSTimeZone.m:

Modified: libs/base/trunk/Source/GSSocketStream.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/GSSocketStream.m?rev=38265&r1=38264&r2=38265&view=diff
==============================================================================
--- libs/base/trunk/Source/GSSocketStream.m     (original)
+++ libs/base/trunk/Source/GSSocketStream.m     Sun Dec 28 12:59:36 2014
@@ -729,6 +729,59 @@
 @interface      GSTLSHandler : GSStreamHandler
 @end
 @implementation GSTLSHandler
+
+static NSArray  *keys = nil;
+
++ (void) initialize
+{
+  if (nil == keys)
+    {
+      keys = [[NSArray alloc] initWithObjects:
+        GSTLSCAFile,
+        GSTLSCertificateFile,
+        GSTLSCertificateKeyFile,
+        GSTLSCertificateKeyPassword,
+        GSTLSDebug,
+        GSTLSPriority,
+        GSTLSRemoteHosts,
+        GSTLSRevokeFile,
+        GSTLSVerify,
+        nil];
+      [[NSObject leakAt: &keys] release];
+    }
+}
+
++ (void) populateProperties: (NSMutableDictionary**)dict
+           withTLSPriority: (NSString*)pri
+           fromInputStream: (NSStream*)i
+            orOutputStream: (NSStream*)o
+{
+  NSString              *str;
+  NSMutableDictionary   *opts = *dict;
+  NSUInteger            count;
+  
+  if (NULL != dict)
+    {
+      if (nil != pri)
+       {
+         [opts setObject: pri forKey: GSTLSPriority];
+       }
+      count = [keys count];
+      while (count-- > 0)
+       {
+         NSString  *key = [keys objectAtIndex: count];
+
+         str = [o propertyForKey: key];
+         if (nil == str) str = [i propertyForKey: key];
+         if (nil != str) [opts setObject: str forKey: key];
+       }
+    }
+  else
+    {
+      NSWarnLog(@"%@ requires not nil 'dict'", NSStringFromSelector(_cmd));
+    }
+}
+
 + (void) tryInput: (GSSocketInputStream*)i output: (GSSocketOutputStream*)o
 {
   NSString     *tls;

Modified: libs/base/trunk/Source/GSTLS.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/GSTLS.m?rev=38265&r1=38264&r2=38265&view=diff
==============================================================================
--- libs/base/trunk/Source/GSTLS.m      (original)
+++ libs/base/trunk/Source/GSTLS.m      Sun Dec 28 12:59:36 2014
@@ -54,6 +54,8 @@
 NSString * const GSTLSRevokeFile = @"GSTLSRevokeFile";
 NSString * const GSTLSVerify = @"GSTLSVerify";
 
+#if     defined(HAVE_GNUTLS)
+
 static NSString *
 standardizedPath(NSString *path)
 {
@@ -68,8 +70,6 @@
     }
   return [path stringByStandardizingPath];
 }
-
-#if     defined(HAVE_GNUTLS)
 
 #if GNUTLS_VERSION_NUMBER <= 0x020b00
 /* Set up locking callbacks for gcrypt so that it will be thread-safe.


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to