Now it crashes!
authorAlexander Strange <astrange@ithinksw.com>
Mon, 17 Mar 2003 00:02:44 +0000 (00:02 +0000)
committerAlexander Strange <astrange@ithinksw.com>
Mon, 17 Mar 2003 00:02:44 +0000 (00:02 +0000)
ITByteStream.h
ITInetSocket.m
ShowcaseController.m

index eeb9c76..027e326 100755 (executable)
@@ -12,6 +12,7 @@
  */
 
 @interface ITByteStream : NSObject {
  */
 
 @interface ITByteStream : NSObject {
+    @public
     NSMutableData *data;
     @private
     NSLock *lock;
     NSMutableData *data;
     @private
     NSLock *lock;
index 0719779..c51c05a 100755 (executable)
     [(id)dp finishedConnecting:self];
 lstart:
 
     [(id)dp finishedConnecting:self];
 lstart:
 
-          while (!actionflag && ![writePipe availableDataLength])
+          while (!actionflag && ![writePipe availableDataLength] && !dieflag)
           {
                  NSData *d;
                  readLen = recv(sockfd,buf,bufs,0);
                  if (readLen) {
                         d = [NSData alloc];
           {
                  NSData *d;
                  readLen = recv(sockfd,buf,bufs,0);
                  if (readLen) {
                         d = [NSData alloc];
-                        [d initWithBytesNoCopy:buf length:readLen];
+                        [d initWithBytesNoCopy:buf length:readLen freeWhenDone:NO];
                         [readPipe writeData:d];
                         [d release];
                         [(id)dp dataReceived:self];
                         [readPipe writeData:d];
                         [d release];
                         [(id)dp dataReceived:self];
index c1eef3c..f3709a3 100755 (executable)
 @implementation ShowcaseController
 - (void)awakeFromNib
 {
 @implementation ShowcaseController
 - (void)awakeFromNib
 {
-    
     ITInetSocket *sock = [[ITInetSocket alloc] initWithDelegate:self];
     NSLog(@"rawr?");
     ITInetSocket *sock = [[ITInetSocket alloc] initWithDelegate:self];
     NSLog(@"rawr?");
-    [sock connectToHost:@"66.111.58.80" onPort:4336];
+    [sock connectToHost:@"irc.freenode.net" onPort:6667];
 }
 
 - (void) finishedConnecting:(in ITInetSocket *)sender {
 }
 
 - (void) finishedConnecting:(in ITInetSocket *)sender {
+    NSString *ircini = @"NICK ITFTest\r\nUSER m0nk3ys . . :Not Tellin'\r\nJOIN #iThink\r\nPRIVMSG #iThink :w00t\r\nQUIT :!\r\n";
     NSLog(@"Done connectin'");
     NSLog(@"Done connectin'");
-    NSData *d = [NSData dataWithBytesNoCopy:"M00f!" length:5];
+    NSData *d = [NSData dataWithBytes:[ircini cString] length:[ircini length]];
     [sender->writePipe writeData:d];
     [sender->writePipe writeData:d];
+    NSLog(@"%@",sender->writePipe->data);
 }
 - (void) errorOccured:(ITInetSocketError)err during:(ITInetSocketState)state onSocket:(in ITInetSocket*)sender {NSLog(@"wtf");[sender retryConnection];}
 - (void) dataReceived:(in ITInetSocket *)sender
 }
 - (void) errorOccured:(ITInetSocketError)err during:(ITInetSocketState)state onSocket:(in ITInetSocket*)sender {NSLog(@"wtf");[sender retryConnection];}
 - (void) dataReceived:(in ITInetSocket *)sender