Differences From Artifact [34ea1ba63e]:
- File
src/OFTCPSocket+SOCKS5.m
— part of check-in
[b96b150ce3]
at
2013-01-22 02:31:22
on branch trunk
— OFStream: Add property for writeBufferEnabled.
This also renames the getter to -[isWriteBufferEnabled]. (user: js, size: 2408) [annotate] [blame] [check-ins using]
To Artifact [76d38f9e30]:
- File
src/OFTCPSocket+SOCKS5.m
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 2409) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
25 26 27 28 29 30 31 | @implementation OFTCPSocket (SOCKS5) - (void)OF_SOCKS5ConnectToHost: (OFString*)host port: (uint16_t)port { const char request[] = { 5, 1, 0, 3 }; char reply[256]; | | | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | @implementation OFTCPSocket (SOCKS5) - (void)OF_SOCKS5ConnectToHost: (OFString*)host port: (uint16_t)port { const char request[] = { 5, 1, 0, 3 }; char reply[256]; bool wasWriteBufferEnabled; /* 5 1 0 -> no authentication */ [self writeBuffer: request length: 3]; [self readIntoBuffer: reply exactLength: 2]; if (reply[0] != 5 || reply[1] != 0) { [self close]; @throw [OFConnectionFailedException exceptionWithClass: [self class] socket: self host: host port: port]; } wasWriteBufferEnabled = [self isWriteBufferEnabled]; [self setWriteBufferEnabled: true]; /* CONNECT request */ [self writeBuffer: request length: 4]; [self writeInt8: [host UTF8StringLength]]; [self writeBuffer: [host UTF8String] length: [host UTF8StringLength]]; |
︙ | ︙ |