OSDN Git Service

Bug fix for issue #67
authorMathewka <mathewka@git.osdn.jp>
Tue, 12 Sep 2017 04:12:21 +0000 (13:12 +0900)
committerMathewka <mathewka@git.osdn.jp>
Tue, 12 Sep 2017 04:12:21 +0000 (13:12 +0900)
39 files changed:
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/AsyncSocket Documentation.html [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/AsyncSocket Documentation.html with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/AsyncSocket.h [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/AsyncSocket.h with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/AsyncSocket.m [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/AsyncSocket.m with 98% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/AsyncUdpSocket.h [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/AsyncUdpSocket.h with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/AsyncUdpSocket.m [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/AsyncUdpSocket.m with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/CertTest/AppController.h [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/CertTest/AppController.h with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/CertTest/AppController.m [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/CertTest/AppController.m with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/CertTest/CertTest.xcodeproj/TemplateIcon.icns [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/CertTest/CertTest.xcodeproj/TemplateIcon.icns with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/CertTest/CertTest.xcodeproj/project.pbxproj [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/CertTest/CertTest.xcodeproj/project.pbxproj with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/CertTest/CertTest_Prefix.pch [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/CertTest/CertTest_Prefix.pch with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/CertTest/English.lproj/InfoPlist.strings [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/CertTest/English.lproj/InfoPlist.strings with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/CertTest/English.lproj/MainMenu.xib [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/CertTest/English.lproj/MainMenu.xib with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/CertTest/Info.plist [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/CertTest/Info.plist with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/CertTest/X509Certificate.h [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/CertTest/X509Certificate.h with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/CertTest/X509Certificate.m [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/CertTest/X509Certificate.m with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/CertTest/main.m [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/CertTest/main.m with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/EchoServer/AppController.h [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/EchoServer/AppController.h with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/EchoServer/AppController.m [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/EchoServer/AppController.m with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/EchoServer/EchoServer.xcodeproj/project.pbxproj [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/EchoServer/EchoServer.xcodeproj/project.pbxproj with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/EchoServer/EchoServer_Prefix.pch [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/EchoServer/EchoServer_Prefix.pch with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/EchoServer/English.lproj/InfoPlist.strings [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/EchoServer/English.lproj/InfoPlist.strings with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/EchoServer/English.lproj/MainMenu.nib/designable.nib [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/EchoServer/English.lproj/MainMenu.nib/designable.nib with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/EchoServer/English.lproj/MainMenu.nib/keyedobjects.nib [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/EchoServer/English.lproj/MainMenu.nib/keyedobjects.nib with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/EchoServer/Info.plist [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/EchoServer/Info.plist with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/EchoServer/Instructions.txt [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/EchoServer/Instructions.txt with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/EchoServer/main.m [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/EchoServer/main.m with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/InterfaceTest/Classes/InterfaceTestAppDelegate.h [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/InterfaceTest/Classes/InterfaceTestAppDelegate.h with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/InterfaceTest/Classes/InterfaceTestAppDelegate.m [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/InterfaceTest/Classes/InterfaceTestAppDelegate.m with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/InterfaceTest/Classes/InterfaceTestViewController.h [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/InterfaceTest/Classes/InterfaceTestViewController.h with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/InterfaceTest/Classes/InterfaceTestViewController.m [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/InterfaceTest/Classes/InterfaceTestViewController.m with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/InterfaceTest/InterfaceTest-Info.plist [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/InterfaceTest/InterfaceTest-Info.plist with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/InterfaceTest/InterfaceTest.xcodeproj/robbie.pbxuser [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/InterfaceTest/InterfaceTest.xcodeproj/robbie.pbxuser with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/InterfaceTest/InterfaceTestViewController.xib [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/InterfaceTest/InterfaceTestViewController.xib with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/InterfaceTest/InterfaceTest_Prefix.pch [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/InterfaceTest/InterfaceTest_Prefix.pch with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/InterfaceTest/MainWindow.xib [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/InterfaceTest/MainWindow.xib with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/InterfaceTest/Readme.txt [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/InterfaceTest/Readme.txt with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/InterfaceTest/main.m [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/InterfaceTest/main.m with 100% similarity]
CocoaAsyncSocket/CocoaAsyncSocket-5.6.4/changes.txt [moved from CocoaAsyncSocket/CocoaAsyncSocket-5.6.3/changes.txt with 100% similarity]
SyncerServer/hosts/racaljkhosts [moved from SyncerServer/SyncerServer/hosts with 100% similarity]

@@ -3510,82 +3510,83 @@ Failed:
                        
                        // Update total amount read in this method invocation
                        totalBytesRead += bytesRead;
-               }
                
-               // Is packet done?
-               if (theCurrentRead->readLength > 0)
-               {
-                       // Read type #2 - read a specific length of data
-                       
-                       done = (theCurrentRead->bytesDone == theCurrentRead->readLength);
-               }
-               else if (theCurrentRead->term != nil)
-               {
-                       // Read type #3 - read up to a terminator
-                       
-                       if (didPreBuffer)
+               
+                       // Is packet done?
+                       if (theCurrentRead->readLength > 0)
                        {
-                               // Search for the terminating sequence within the big chunk we just read.
+                               // Read type #2 - read a specific length of data
                                
-                               NSInteger overflow = [theCurrentRead searchForTermAfterPreBuffering:result];
+                               done = (theCurrentRead->bytesDone == theCurrentRead->readLength);
+                       }
+                       else if (theCurrentRead->term != nil)
+                       {
+                               // Read type #3 - read up to a terminator
                                
-                               if (overflow > 0)
+                               if (didPreBuffer)
                                {
-                                       // Copy excess data into partialReadBuffer
-                                       void *overflowBuffer = buffer + theCurrentRead->bytesDone - overflow;
+                                       // Search for the terminating sequence within the big chunk we just read.
                                        
-                                       [partialReadBuffer appendBytes:overflowBuffer length:overflow];
+                                       NSInteger overflow = [theCurrentRead searchForTermAfterPreBuffering:result];
                                        
-                                       // Update the bytesDone variable.
-                                       theCurrentRead->bytesDone -= overflow;
+                                       if (overflow > 0)
+                                       {
+                                               // Copy excess data into partialReadBuffer
+                                               void *overflowBuffer = buffer + theCurrentRead->bytesDone - overflow;
+                                               
+                                               [partialReadBuffer appendBytes:overflowBuffer length:overflow];
+                                               
+                                               // Update the bytesDone variable.
+                                               theCurrentRead->bytesDone -= overflow;
+                                               
+                                               // Note: The completeCurrentRead method will trim the buffer for us.
+                                       }
                                        
-                                       // Note: The completeCurrentRead method will trim the buffer for us.
+                                       done = (overflow >= 0);
                                }
-                               
-                               done = (overflow >= 0);
-                       }
-                       else if (didReadFromPreBuffer)
-                       {
-                               // Our 'done' variable was updated via the readLengthForTermWithPreBuffer:found: method
-                       }
-                       else
-                       {
-                               // Search for the terminating sequence at the end of the buffer
-                               
-                               NSUInteger termlen = [theCurrentRead->term length];
-                               
-                               if(theCurrentRead->bytesDone >= termlen)
+                               else if (didReadFromPreBuffer)
+                               {
+                                       // Our 'done' variable was updated via the readLengthForTermWithPreBuffer:found: method
+                               }
+                               else
                                {
-                                       void *bufferEnd = buffer + (theCurrentRead->bytesDone - termlen);
+                                       // Search for the terminating sequence at the end of the buffer
                                        
-                                       const void *seq = [theCurrentRead->term bytes];
+                                       NSUInteger termlen = [theCurrentRead->term length];
                                        
-                                       done = (memcmp (bufferEnd, seq, termlen) == 0);
+                                       if(theCurrentRead->bytesDone >= termlen)
+                                       {
+                                               void *bufferEnd = buffer + (theCurrentRead->bytesDone - termlen);
+                                               
+                                               const void *seq = [theCurrentRead->term bytes];
+                                               
+                                               done = (memcmp (bufferEnd, seq, termlen) == 0);
+                                       }
                                }
-                       }
-                       
-                       if(!done && theCurrentRead->maxLength > 0)
-                       {
-                               // We're not done and there's a set maxLength.
-                               // Have we reached that maxLength yet?
                                
-                               if(theCurrentRead->bytesDone >= theCurrentRead->maxLength)
+                               if(!done && theCurrentRead->maxLength > 0)
                                {
-                                       maxoutError = YES;
+                                       // We're not done and there's a set maxLength.
+                                       // Have we reached that maxLength yet?
+                                       
+                                       if(theCurrentRead->bytesDone >= theCurrentRead->maxLength)
+                                       {
+                                               maxoutError = YES;
+                                       }
                                }
                        }
-               }
-               else
-               {
-                       // Read type #1 - read all available data
-                       // 
-                       // We're done when:
-                       // - we reach maxLength (if there is a max)
-                       // - all readable is read (see below)
-                       
-                       if (theCurrentRead->maxLength > 0)
+                       else
                        {
-                               done = (theCurrentRead->bytesDone >= theCurrentRead->maxLength);
+                               // Read type #1 - read all available data
+                               // 
+                               // We're done when:
+                               // - we reach maxLength (if there is a max)
+                               // - all readable is read (see below)
+                               
+                               if (theCurrentRead->maxLength > 0)
+                               {
+                                       done = (theCurrentRead->bytesDone >= theCurrentRead->maxLength);
+                               }
                        }
                }
        }