Changeset 113

Show
Ignore:
Timestamp:
08/20/07 04:22:59 (1 year ago)
Author:
eric
Message:

Misread the docs... reverting some of the changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/eric/Libs/SSHAgent.m

    r112 r113  
    246246- (void)handleAgentConnections 
    247247{ 
    248         NSTask *currentAgent = agentTask
     248        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]
    249249 
    250250        /* Fill the sockaddr_un structs. */ 
     
    264264                NSLog(@"handleAgentConnections: socket() failed"); 
    265265                [self stop]; 
     266                [pool release]; 
    266267                return; 
    267268        } 
     
    275276                        NSLog(@"handleAgentConnections: bind() failed"); 
    276277                        [self stop]; 
     278                        [pool release]; 
    277279                        return; 
    278280                } 
     
    284286                NSLog(@"handleAgentConnections: listen() failed"); 
    285287                [self stop]; 
     288                [pool release]; 
    286289                return; 
    287290        } 
     
    295298                NSLog(@"handleAgentConnections: malloc() failed"); 
    296299                [self stop]; 
     300                [pool release]; 
    297301                return; 
    298302        } 
     
    311315        while ((result = select(largestFileDescriptor + 1, &readFileDescriptors, NULL, NULL, NULL))) 
    312316        { 
    313                 if (agentTask != currentAgent) { 
    314                         NSLog(@"handleAgentConnections: Hmmm our agent has gone away, close shop and hope the next one is up and running"); 
    315                         [self stop]; 
    316                         free(allFileDescriptors); 
    317                         return; 
    318                 } 
    319317                if (result == -1 && errno == EINTR) 
    320318                        continue; 
     
    326324                        [self stop]; 
    327325                        free(allFileDescriptors); 
     326                        [pool release]; 
    328327                        return; 
    329328                } 
     
    343342                                        NSLog(@"handleAgentConnections: realloc() failed"); 
    344343                                        [self stop]; 
     344                                        [pool release]; 
    345345                                        return; 
    346346                                } 
     
    359359                                [self stop]; 
    360360                                free(allFileDescriptors); 
     361                                [pool release]; 
    361362                                return; 
    362363                        } 
     
    371372                                [self stop]; 
    372373                                free(allFileDescriptors); 
     374                                [pool release]; 
    373375                                return; 
    374376                        } 
     
    466468 
    467469        free(allFileDescriptors); 
     470        [pool release]; 
    468471} 
    469472 
     
    471474- (void)inputFromClient:(id)object 
    472475{ 
     476        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 
     477 
    473478        int destinationFileDescriptor = [[object objectAtIndex:0] intValue]; 
    474479        const char *readBuffer = [[object objectAtIndex:1] cString]; 
     
    504509                                write(sourceFileDescriptor, "\0\0\0\5\2\0\0\0\0", 9); 
    505510 
     511                                [pool release]; 
    506512                                return; 
    507513                        } 
     
    512518                                write(sourceFileDescriptor, "\0\0\0\5\f\0\0\0\0", 9); 
    513519 
     520                                [pool release]; 
    514521                                return; 
    515522                        } 
     
    526533        /* Write the buffer to the agent. */ 
    527534        write(destinationFileDescriptor, readBuffer, len); 
     535        [pool release]; 
    528536} 
    529537