Differences From Artifact [36820b9499]:
- File
src/OFTCPSocket.m
— part of check-in
[d7ddb3dbc7]
at
2020-04-26 19:39:06
on branch trunk
— Remove redundant arguments from blocks
Arguments that can just be captured by the block don't need to be
repeated as an argument. A lot of arguments passed to a delegate are
therefore not needed for a block. (user: js, size: 22984) [annotate] [blame] [check-ins using]
To Artifact [ef285e844b]:
- File src/OFTCPSocket.m — part of check-in [857f8edc09] at 2020-04-29 23:59:08 on branch trunk — Add OFSPXSocket (user: js, size: 22624) [annotate] [blame] [check-ins using]
︙ | |||
11 12 13 14 15 16 17 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - | * * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ |
︙ | |||
99 100 101 102 103 104 105 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | - + - - - - - - + + | } - (instancetype)initWithSocket: (OFTCPSocket *)sock host: (OFString *)host port: (uint16_t)port SOCKS5Host: (OFString *)SOCKS5Host SOCKS5Port: (uint16_t)SOCKS5Port |
︙ | |||
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - | @implementation OFTCPSocketAsyncConnectDelegate - (instancetype)initWithSocket: (OFTCPSocket *)sock host: (OFString *)host port: (uint16_t)port SOCKS5Host: (OFString *)SOCKS5Host SOCKS5Port: (uint16_t)SOCKS5Port delegate: (id <OFTCPSocketDelegate>)delegate #ifdef OF_HAVE_BLOCKS block: (of_tcp_socket_async_connect_block_t)block #endif { self = [super init]; @try { _socket = [sock retain]; _host = [host copy]; _port = port; _SOCKS5Host = [SOCKS5Host copy]; _SOCKS5Port = SOCKS5Port; _delegate = [delegate retain]; #ifdef OF_HAVE_BLOCKS _block = [block copy]; #endif _socket.delegate = self; } @catch (id e) { [self release]; @throw e; } return self; } |
︙ | |||
263 264 265 266 267 268 269 270 271 272 273 274 275 276 | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | + + + + + + + + | } if (_SOCKS5Host != nil) [self sendSOCKS5Request]; else [self didConnect]; } - (id)of_connectionFailedExceptionForErrNo: (int)errNo { return [OFConnectionFailedException exceptionWithHost: _host port: _port socket: _socket errNo: errNo]; } - (void)tryNextAddressWithRunLoopMode: (of_run_loop_mode_t)runLoopMode { of_socket_address_t address = *(const of_socket_address_t *) [_socketAddresses itemAtIndex: _socketAddressesIndex++]; int errNo; |
︙ | |||
699 700 701 702 703 704 705 | 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 | - + | - (bool)of_connectSocketToAddress: (const of_socket_address_t *)address errNo: (int *)errNo { if (_socket == INVALID_SOCKET) @throw [OFNotOpenException exceptionWithObject: self]; |
︙ | |||
764 765 766 767 768 769 770 | 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | - - + + + + + | [[[[OFTCPSocketAsyncConnectDelegate alloc] initWithSocket: self host: host port: port SOCKS5Host: _SOCKS5Host SOCKS5Port: _SOCKS5Port |
︙ | |||
794 795 796 797 798 799 800 801 802 803 804 805 806 807 | 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 | + | [[[[OFTCPSocketAsyncConnectDelegate alloc] initWithSocket: self host: host port: port SOCKS5Host: _SOCKS5Host SOCKS5Port: _SOCKS5Port delegate: nil block: block] autorelease] startWithRunLoopMode: runLoopMode]; objc_autoreleasePoolPop(pool); } #endif |
︙ |