Ticket #1240: Colloquy-malformed-dcc-send.diff

File Colloquy-malformed-dcc-send.diff, 3.0 kB (added by nox, 6 months ago)
  • Chat

    old new  
    112112        [self _setPort:port]; 
    113113 
    114114        NSString *fileName = [[self source] lastPathComponent]; 
    115         if( _fileNameQuoted ) [[self user] sendSubcodeRequest:@"DCC" withArguments:[NSString stringWithFormat:@"SEND \"%@\" %@ %hu %llu T", fileName, address, [self port], [self finalSize]]]; 
    116         else [[self user] sendSubcodeRequest:@"DCC" withArguments:[NSString stringWithFormat:@"SEND %@ %@ %hu %llu T", fileName, address, [self port], [self finalSize]]]; 
     115        if( _fileNameQuoted ) [[self user] sendSubcodeRequest:@"DCC" withArguments:[NSString stringWithFormat:@"SEND \"%@\" %@ %hu %llu", fileName, address, [self port], [self finalSize]]]; 
     116        else [[self user] sendSubcodeRequest:@"DCC" withArguments:[NSString stringWithFormat:@"SEND %@ %@ %hu %llu", fileName, address, [self port], [self finalSize]]]; 
    117117} 
    118118 
    119119- (void) directClientConnection:(MVDirectClientConnection *) connection willDisconnectWithError:(NSError *) error { 
     
    259259 
    260260- (void) reject { 
    261261        if( [self isPassive] ) { 
    262                 if( _fileNameQuoted ) [[self user] sendSubcodeReply:@"DCC" withArguments:[NSString stringWithFormat:@"REJECT SEND \"%@\" 16843009 0 %llu %luT", [self originalFileName], [self finalSize], [self _passiveIdentifier]]]; 
    263                 else [[self user] sendSubcodeReply:@"DCC" withArguments:[NSString stringWithFormat:@"REJECT SEND %@ 16843009 0 %llu %luT", [self originalFileName], [self finalSize], [self _passiveIdentifier]]]; 
     262                if( _fileNameQuoted ) [[self user] sendSubcodeReply:@"DCC" withArguments:[NSString stringWithFormat:@"REJECT SEND \"%@\" 16843009 0 %llu %lu", [self originalFileName], [self finalSize], [self _passiveIdentifier]]]; 
     263                else [[self user] sendSubcodeReply:@"DCC" withArguments:[NSString stringWithFormat:@"REJECT SEND %@ 16843009 0 %llu %lu", [self originalFileName], [self finalSize], [self _passiveIdentifier]]]; 
    264264        } else { 
    265265                NSString *address = [[self host] address]; 
    266266                if( ! address ) address = @"16843009"; 
    267267                if( address && [address rangeOfString:@"."].location != NSNotFound ) 
    268268                        address = [NSString stringWithFormat:@"%lu", ntohl( inet_addr( [address UTF8String] ) )]; 
    269                 if( _fileNameQuoted ) [[self user] sendSubcodeReply:@"DCC" withArguments:[NSString stringWithFormat:@"REJECT SEND \"%@\" %@ %hu %llu T", [self originalFileName], address, [self port], [self finalSize]]]; 
    270                 else [[self user] sendSubcodeReply:@"DCC" withArguments:[NSString stringWithFormat:@"REJECT SEND %@ %@ %hu %llu T", [self originalFileName], address, [self port], [self finalSize]]]; 
     269                if( _fileNameQuoted ) [[self user] sendSubcodeReply:@"DCC" withArguments:[NSString stringWithFormat:@"REJECT SEND \"%@\" %@ %hu %llu", [self originalFileName], address, [self port], [self finalSize]]]; 
     270                else [[self user] sendSubcodeReply:@"DCC" withArguments:[NSString stringWithFormat:@"REJECT SEND %@ %@ %hu %llu", [self originalFileName], address, [self port], [self finalSize]]]; 
    271271        } 
    272272 
    273273        [self cancel];