Changeset 3554
- Timestamp:
- 01/15/07 14:35:11 (2 years ago)
- Files:
-
- trunk/Chat Core/MVChatConnection.m (modified) (1 diff)
- trunk/Chat Core/MVIRCChatConnection.m (modified) (5 diffs)
- trunk/Controllers/MVConnectionsController.m (modified) (2 diffs)
- trunk/Inspectors/JVConnectionInspector.m (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Chat Core/MVChatConnection.m
r3539 r3554 112 112 else if( [[serverURL scheme] isEqualToString:@"silc"] ) connectionType = MVChatConnectionSILCType; 113 113 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]] ) ) { 115 115 [self setNicknamePassword:[serverURL password]]; 116 116 trunk/Chat Core/MVIRCChatConnection.m
r3550 r3554 1644 1644 } 1645 1645 1646 port %= 65535; // some clients use ports greater than 65535, mod with 65535 to get the real port 1647 1646 1648 if( passive && port > 0 ) { 1647 1649 // this is a passive reply, look up the original transfer … … 1700 1702 passive = YES; 1701 1703 1704 port %= 65535; // some clients use ports greater than 65535, mod with 65535 to get the real port 1705 1702 1706 @synchronized( _directClientConnections ) { 1703 1707 NSEnumerator *enumerator = [_directClientConnections objectEnumerator]; … … 1734 1738 passive = YES; 1735 1739 1740 port %= 65535; // some clients use ports greater than 65535, mod with 65535 to get the real port 1741 1736 1742 @synchronized( _directClientConnections ) { 1737 1743 NSEnumerator *enumerator = [_directClientConnections objectEnumerator]; … … 1774 1780 } 1775 1781 1782 port %= 65535; // some clients use ports greater than 65535, mod with 65535 to get the real port 1783 1776 1784 if( [fileName isCaseInsensitiveEqualToString:@"CHAT"] || [fileName isCaseInsensitiveEqualToString:@"C H A T"] ) { 1777 1785 if( passive && port > 0 ) { … … 1854 1862 if( [scanner scanLongLong:NULL] && [scanner scanLongLong:&passiveId] ) 1855 1863 passive = YES; 1864 1865 port %= 65535; // some clients use ports greater than 65535, mod with 65535 to get the real port 1856 1866 1857 1867 @synchronized( _directClientConnections ) { trunk/Controllers/MVConnectionsController.m
r3544 r3554 340 340 } 341 341 342 if( [newPort intValue] < 0 || [newPort intValue] > 65535) {342 if( [newPort intValue] < 0 ) { 343 343 [[self window] makeFirstResponder:newPort]; 344 344 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 ); … … 1148 1148 [(MVChatConnection *)[[_bookmarks objectAtIndex:row] objectForKey:@"connection"] setServer:object]; 1149 1149 } 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 )]; 1151 1151 } 1152 1152 [self _saveBookmarkList]; trunk/Inspectors/JVConnectionInspector.m
r3487 r3554 179 179 [_connection setUsername:[sender stringValue]]; 180 180 } else if( sender == editPort ) { 181 [_connection setServerPort:( unsigned short)[sender intValue]];181 [_connection setServerPort:( (unsigned int)[sender intValue] % 65535 )]; 182 182 } 183 183 }
