ObjFW  Check-in [6bd1d03cc1]

Overview
Comment:OFTCPSocket+SOCKS5: Don't send in native encoding.

There is no standard on which encoding to use for IDNs. Probably, it
would be best to encode them in Punycode before sending them over the
wire, but for now, we just hope the other end understands UTF-8.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6bd1d03cc152dced0ddfd35d7058c0b8dcfc1e40e3971579a01af04668a75c8a
User & Date: js on 2013-01-08 03:13:35
Other Links: manifest | tags
Context
2013-01-08
03:41
OFProcess: Kill the process in -[close]. check-in: 382e89a033 user: js tags: trunk
03:13
OFTCPSocket+SOCKS5: Don't send in native encoding. check-in: 6bd1d03cc1 user: js tags: trunk
03:13
Win32: Allow Unicode filenames in file operations. check-in: 94a9a18106 user: js tags: trunk
Changes

Modified src/OFTCPSocket+SOCKS5.m from [2044202797] to [52796c9ef4].

49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

	oldWriteBufferEnabled = [self writeBufferEnabled];
	[self setWriteBufferEnabled: YES];

	/* CONNECT request */
	[self writeBuffer: request
		   length: 4];
	[self writeInt8:
	    [host lengthOfBytesUsingEncoding: OF_STRING_ENCODING_NATIVE]];
	[self writeBuffer: [host cStringUsingEncoding:
			       OF_STRING_ENCODING_NATIVE]
		   length: [host lengthOfBytesUsingEncoding:
			       OF_STRING_ENCODING_NATIVE]];
	[self writeBigEndianInt16: port];

	[self flushWriteBuffer];
	[self setWriteBufferEnabled: oldWriteBufferEnabled];

	[self readIntoBuffer: reply
		 exactLength: 4];







|
<
|
<
|
<







49
50
51
52
53
54
55
56

57

58

59
60
61
62
63
64
65

	oldWriteBufferEnabled = [self writeBufferEnabled];
	[self setWriteBufferEnabled: YES];

	/* CONNECT request */
	[self writeBuffer: request
		   length: 4];
	[self writeInt8: [host UTF8StringLength]];

	[self writeBuffer: [host UTF8String]

		   length: [host UTF8StringLength]];

	[self writeBigEndianInt16: port];

	[self flushWriteBuffer];
	[self setWriteBufferEnabled: oldWriteBufferEnabled];

	[self readIntoBuffer: reply
		 exactLength: 4];