mirror of
https://github.com/Codeux-Software/Textual.git
synced 2026-06-16 13:24:32 +00:00
Many resources have been added to Textual with little thought for long term maintenance. This commit is an overdue overhaul of the entire project. The goals of this overhaul was to introduce as much consistency as possible to the project. Some notable changes: • Code signing identity file has moved to "Configurations/Build" • All build configuration files, including entitlements, moved to "Configurations" • Source code for the app has moved to "Sources/App" • Shared source code has moved to "Sources/Shared" • Source code for extensions have moved to "Sources/Plugins" • The project file for the app has moved along with its source code. It's recommended to use the Textual.xcworkspace workspace file. • Build scripts are no longer packaged within the project files. • Folders are now used throughout most projects instead of groups. • Removed a lot of redundant framework linking. • The preference panel sample plugin has been modified to use standard Cocoa facilities instead of those that are project specific. e.g. NSUserDefaults and NSLog() instead of TPCPreferencesUserDefaults and LogToConsole()
80 lines
2.7 KiB
Plaintext
80 lines
2.7 KiB
Plaintext
commit c0e472e058df72293d9a313dc1b0d8437f3af4ae
|
|
Author: Michael Morris <michael@codeux.com>
|
|
Date: Tue Jul 5 21:21:13 2016 -0400
|
|
|
|
Patches for Textual
|
|
|
|
diff --git a/Source/GCD/GCDAsyncSocket.m b/Source/GCD/GCDAsyncSocket.m
|
|
old mode 100644
|
|
new mode 100755
|
|
index 1f13e36..c826db8
|
|
--- a/Source/GCD/GCDAsyncSocket.m
|
|
+++ b/Source/GCD/GCDAsyncSocket.m
|
|
@@ -29,6 +29,8 @@
|
|
#import <sys/un.h>
|
|
#import <unistd.h>
|
|
|
|
+#define GCDAsyncSocketUsesStrictTimers 1
|
|
+
|
|
#if ! __has_feature(objc_arc)
|
|
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
|
// For more information see: https://github.com/robbiehanson/CocoaAsyncSocket/wiki/ARC
|
|
@@ -508,7 +510,7 @@ - (NSUInteger)readLengthForNonTermWithHint:(NSUInteger)bytesAvailable
|
|
{
|
|
// Read a specific length of data
|
|
|
|
- return MIN(bytesAvailable, (readLength - bytesDone));
|
|
+ return (readLength - bytesDone);
|
|
|
|
// No need to avoid resizing the buffer.
|
|
// If the user provided their own buffer,
|
|
@@ -3010,7 +3012,11 @@ - (void)startConnectTimeout:(NSTimeInterval)timeout
|
|
{
|
|
if (timeout >= 0.0)
|
|
{
|
|
+#if GCDAsyncSocketUsesStrictTimers == 1
|
|
+ connectTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, DISPATCH_TIMER_STRICT, socketQueue);
|
|
+#else
|
|
connectTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, socketQueue);
|
|
+#endif
|
|
|
|
__weak GCDAsyncSocket *weakSelf = self;
|
|
|
|
@@ -5664,8 +5670,12 @@ - (void)setupReadTimerWithTimeout:(NSTimeInterval)timeout
|
|
{
|
|
if (timeout >= 0.0)
|
|
{
|
|
+#if GCDAsyncSocketUsesStrictTimers == 1
|
|
+ readTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, DISPATCH_TIMER_STRICT, socketQueue);
|
|
+#else
|
|
readTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, socketQueue);
|
|
-
|
|
+#endif
|
|
+
|
|
__weak GCDAsyncSocket *weakSelf = self;
|
|
|
|
dispatch_source_set_event_handler(readTimer, ^{ @autoreleasepool {
|
|
@@ -6307,8 +6317,12 @@ - (void)setupWriteTimerWithTimeout:(NSTimeInterval)timeout
|
|
{
|
|
if (timeout >= 0.0)
|
|
{
|
|
+#if GCDAsyncSocketUsesStrictTimers == 1
|
|
+ writeTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, DISPATCH_TIMER_STRICT, socketQueue);
|
|
+#else
|
|
writeTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, socketQueue);
|
|
-
|
|
+#endif
|
|
+
|
|
__weak GCDAsyncSocket *weakSelf = self;
|
|
|
|
dispatch_source_set_event_handler(writeTimer, ^{ @autoreleasepool {
|
|
@@ -7011,7 +7025,7 @@ - (void)ssl_startTLS
|
|
for (cipherIndex = 0; cipherIndex < numberCiphers; cipherIndex++)
|
|
{
|
|
NSNumber *cipherObject = [cipherSuites objectAtIndex:cipherIndex];
|
|
- ciphers[cipherIndex] = [cipherObject shortValue];
|
|
+ ciphers[cipherIndex] = [cipherObject intValue];
|
|
}
|
|
|
|
status = SSLSetEnabledCiphers(sslContext, ciphers, numberCiphers);
|