Changeset 5407

Show
Ignore:
Timestamp:
03/15/08 09:32:27 (4 months ago)
Author:
morris
Message:

Sync with libwired

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredAdditions/trunk/WNSocket.h

    r5396 r5407  
    3636+ (WNSocketTLS *)socketTLSForClient; 
    3737 
    38 - (void)setSSLCiphers:(NSString *)iphers; 
     38- (wi_socket_tls_t *)TLS; 
     39 
     40- (void)setSSLCiphers:(NSString *)ciphers; 
    3941 
    4042@end 
  • WiredAdditions/trunk/WNSocket.m

    r5396 r5407  
    3636@interface WNSocketTLS(Private) 
    3737 
    38 - (wi_socket_tls_t *)_tls
     38- (id)_initForClient
    3939 
    4040@end 
     
    4343@implementation WNSocketTLS(Private) 
    4444 
    45 - (wi_socket_tls_t *)_tls { 
    46         return _tls; 
     45- (id)_initForClient { 
     46        wi_pool_t       *pool; 
     47         
     48        self = [super init]; 
     49         
     50        pool = wi_pool_init(wi_pool_alloc()); 
     51        _tls = wi_socket_tls_init_with_type(wi_socket_tls_alloc(), WI_SOCKET_TLS_CLIENT); 
     52        wi_release(pool); 
     53 
     54        return self; 
    4755} 
    4856 
     
    5361 
    5462+ (WNSocketTLS *)socketTLSForClient { 
    55         WNSocketTLS             *tls; 
    56          
    57         tls = [[self alloc] init]; 
    58  
    59         wi_socket_tls_set_type(tls->_tls, WI_SOCKET_TLS_CLIENT); 
    60          
    61         return [tls autorelease]; 
    62 
    63  
    64  
    65  
    66 - (id)init { 
    67         wi_pool_t       *pool; 
    68          
    69         self = [super init]; 
    70          
    71         pool = wi_pool_init(wi_pool_alloc()); 
    72         _tls = wi_socket_tls_init(wi_socket_tls_alloc()); 
    73         wi_release(pool); 
    74          
    75         return self; 
     63        return [[[self alloc] _initForClient] autorelease]; 
    7664} 
    7765 
     
    8270         
    8371        [super dealloc]; 
     72} 
     73 
     74 
     75 
     76#pragma mark - 
     77 
     78- (wi_socket_tls_t *)TLS { 
     79        return _tls; 
    8480} 
    8581 
     
    369365        pool = wi_pool_init(wi_pool_alloc()); 
    370366         
    371         if(!wi_socket_connect_tls(_socket, [tls _tls], timeout)) { 
     367        if(!wi_socket_connect_tls(_socket, [tls TLS], timeout)) { 
    372368                if(error) { 
    373369                        *error = [WNError errorWithDomain:WNWiredNetworkingErrorDomain