Differences From Artifact [34fdf0c261]:
- File
src/OFTCPSocket.m
— part of check-in
[366ce5073a]
at
2019-05-05 23:02:36
on branch trunk
— OFTCPSocket: Work around missing EPROTO
This is required for MorphOS. (user: js, size: 26056) [annotate] [blame] [check-ins using]
To Artifact [bfc7e59ebf]:
- File src/OFTCPSocket.m — part of check-in [17d57e01ff] at 2019-06-17 02:33:47 on branch trunk — Remove underscores from class names (user: js, size: 26048) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
62 63 64 65 66 67 68 | @"of_tcp_socket_connect_mode"; Class of_tls_socket_class = Nil; static OFString *defaultSOCKS5Host = nil; static uint16_t defaultSOCKS5Port = 1080; | | | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | @"of_tcp_socket_connect_mode"; Class of_tls_socket_class = Nil; static OFString *defaultSOCKS5Host = nil; static uint16_t defaultSOCKS5Port = 1080; @interface OFTCPSocketAsyncConnectDelegate: OFObject <OFTCPSocketDelegate, OFTCPSocketDelegate_Private, OFDNSResolverDelegate> { OFTCPSocket *_socket; OFString *_host; uint16_t _port; OFString *_SOCKS5Host; uint16_t _SOCKS5Port; |
︙ | ︙ | |||
110 111 112 113 114 115 116 | #endif - (void)didConnect; - (void)tryNextAddressWithRunLoopMode: (of_run_loop_mode_t)runLoopMode; - (void)startWithRunLoopMode: (of_run_loop_mode_t)runLoopMode; - (void)sendSOCKS5Request; @end | | | | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | #endif - (void)didConnect; - (void)tryNextAddressWithRunLoopMode: (of_run_loop_mode_t)runLoopMode; - (void)startWithRunLoopMode: (of_run_loop_mode_t)runLoopMode; - (void)sendSOCKS5Request; @end @interface OFTCPSocketConnectDelegate: OFObject <OFTCPSocketDelegate> { @public bool _done; id _exception; } @end @implementation OFTCPSocketAsyncConnectDelegate - (instancetype)initWithSocket: (OFTCPSocket *)sock host: (OFString *)host port: (uint16_t)port SOCKS5Host: (OFString *)SOCKS5Host SOCKS5Port: (uint16_t)SOCKS5Port delegate: (id <OFTCPSocketDelegate>)delegate { |
︙ | ︙ | |||
576 577 578 579 580 581 582 | default: assert(0); return nil; } } @end | | | 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 | default: assert(0); return nil; } } @end @implementation OFTCPSocketConnectDelegate - (void)dealloc { [_exception release]; [super dealloc]; } |
︙ | ︙ | |||
707 708 709 710 711 712 713 | #endif - (void)connectToHost: (OFString *)host port: (uint16_t)port { void *pool = objc_autoreleasePoolPush(); id <OFTCPSocketDelegate> delegate = [_delegate retain]; | | | | 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 | #endif - (void)connectToHost: (OFString *)host port: (uint16_t)port { void *pool = objc_autoreleasePoolPush(); id <OFTCPSocketDelegate> delegate = [_delegate retain]; OFTCPSocketConnectDelegate *connectDelegate = [[[OFTCPSocketConnectDelegate alloc] init] autorelease]; OFRunLoop *runLoop = [OFRunLoop currentRunLoop]; self.delegate = connectDelegate; [self asyncConnectToHost: host port: port runLoopMode: connectRunLoopMode]; |
︙ | ︙ | |||
746 747 748 749 750 751 752 | - (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode { void *pool = objc_autoreleasePoolPush(); | | | 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 | - (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode { void *pool = objc_autoreleasePoolPush(); [[[[OFTCPSocketAsyncConnectDelegate alloc] initWithSocket: self host: host port: port SOCKS5Host: _SOCKS5Host SOCKS5Port: _SOCKS5Port delegate: _delegate] autorelease] startWithRunLoopMode: runLoopMode]; |
︙ | ︙ | |||
776 777 778 779 780 781 782 | - (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode block: (of_tcp_socket_async_connect_block_t)block { void *pool = objc_autoreleasePoolPush(); | | | 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 | - (void)asyncConnectToHost: (OFString *)host port: (uint16_t)port runLoopMode: (of_run_loop_mode_t)runLoopMode block: (of_tcp_socket_async_connect_block_t)block { void *pool = objc_autoreleasePoolPush(); [[[[OFTCPSocketAsyncConnectDelegate alloc] initWithSocket: self host: host port: port SOCKS5Host: _SOCKS5Host SOCKS5Port: _SOCKS5Port block: block] autorelease] startWithRunLoopMode: runLoopMode]; |
︙ | ︙ |