Changeset 3554

Show
Ignore:
Timestamp:
01/15/07 14:35:11 (2 years ago)
Author:
timothy
Message:

Some people expect to use ports greater than 65535, we will now allow it for new connections and DCC requests by moding the port number with 65535 before using it.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Chat Core/MVChatConnection.m

    r3539 r3554  
    112112        else if( [[serverURL scheme] isEqualToString:@"silc"] ) connectionType = MVChatConnectionSILCType; 
    113113 
    114         if( ( self = [self initWithServer:[serverURL host] type:connectionType port:[[serverURL port] unsignedShortValue] user:[serverURL user]] ) ) { 
     114        if( ( self = [self initWithServer:[serverURL host] type:connectionType port:( [[serverURL port] unsignedIntValue] % 65535 ) user:[serverURL user]] ) ) { 
    115115                [self setNicknamePassword:[serverURL password]]; 
    116116 
  • trunk/Chat Core/MVIRCChatConnection.m

    r3550 r3554  
    16441644                                } 
    16451645 
     1646                                port %= 65535; // some clients use ports greater than 65535, mod with 65535 to get the real port 
     1647 
    16461648                                if( passive && port > 0 ) { 
    16471649                                        // this is a passive reply, look up the original transfer 
     
    17001702                                        passive = YES; 
    17011703 
     1704                                port %= 65535; // some clients use ports greater than 65535, mod with 65535 to get the real port 
     1705 
    17021706                                @synchronized( _directClientConnections ) { 
    17031707                                        NSEnumerator *enumerator = [_directClientConnections objectEnumerator]; 
     
    17341738                                        passive = YES; 
    17351739 
     1740                                port %= 65535; // some clients use ports greater than 65535, mod with 65535 to get the real port 
     1741 
    17361742                                @synchronized( _directClientConnections ) { 
    17371743                                        NSEnumerator *enumerator = [_directClientConnections objectEnumerator]; 
     
    17741780                                } 
    17751781 
     1782                                port %= 65535; // some clients use ports greater than 65535, mod with 65535 to get the real port 
     1783 
    17761784                                if( [fileName isCaseInsensitiveEqualToString:@"CHAT"] || [fileName isCaseInsensitiveEqualToString:@"C H A T"] ) { 
    17771785                                        if( passive && port > 0 ) { 
     
    18541862                                        if( [scanner scanLongLong:NULL] && [scanner scanLongLong:&passiveId] ) 
    18551863                                                passive = YES; 
     1864 
     1865                                        port %= 65535; // some clients use ports greater than 65535, mod with 65535 to get the real port 
    18561866 
    18571867                                        @synchronized( _directClientConnections ) { 
  • trunk/Controllers/MVConnectionsController.m

    r3544 r3554  
    340340        } 
    341341 
    342         if( [newPort intValue] < 0 || [newPort intValue] > 65535 ) { 
     342        if( [newPort intValue] < 0 ) { 
    343343                [[self window] makeFirstResponder:newPort]; 
    344344                NSRunCriticalAlertPanel( NSLocalizedString( @"Chat Server Port is invalid", "chat invalid nickname dialog title" ), NSLocalizedString( @"The chat server port you specified is invalid because it can't be negative or greater than 65535.", "chat server port invalid dialog message" ), nil, nil, nil ); 
     
    11481148                        [(MVChatConnection *)[[_bookmarks objectAtIndex:row] objectForKey:@"connection"] setServer:object]; 
    11491149                } else if( [[column identifier] isEqual:@"port"] ) { 
    1150                         [(MVChatConnection *)[[_bookmarks objectAtIndex:row] objectForKey:@"connection"] setServerPort:[object unsignedShortValue]]; 
     1150                        [(MVChatConnection *)[[_bookmarks objectAtIndex:row] objectForKey:@"connection"] setServerPort:( [object unsignedIntValue] % 65535 )]; 
    11511151                } 
    11521152                [self _saveBookmarkList]; 
  • trunk/Inspectors/JVConnectionInspector.m

    r3487 r3554  
    179179                [_connection setUsername:[sender stringValue]]; 
    180180        } else if( sender == editPort ) { 
    181                 [_connection setServerPort:(unsigned short)[sender intValue]]; 
     181                [_connection setServerPort:( (unsigned int)[sender intValue] % 65535 )]; 
    182182        } 
    183183}