do
{
memset(&buf, '\0', sizeof(buf));
- sleep(1);
numbytes = libssh2_channel_read(channel, buf, sizeof(buf));
+ sleep(1);
#ifdef BLU_DEBUG
NSLog(@"buf: %s", buf);
#endif
- } while (numbytes > 0);
+ } while (libssh2_poll_channel_read(channel, 0));
}
/**
[progress setHidden:NO];
[status setHidden:NO];
- NSString *printer = [[printersController selection] valueForKey:@"unixName"];
FILE *localFile;
struct stat fileInfo;
[self readChannel:channel];
// send the job to lpr
- char *cmd = (char *)[[NSString stringWithFormat:@"lpr -m -P%@ __bu_print_drop__.pdf\r\n\0", printer] UTF8String];
+ char *cmd;
+#ifndef BLU_DEBUG
+ NSString *printer = [[printersController selection] valueForKey:@"unixName"];
+ cmd = (char *)[[NSString stringWithFormat:@"lpr -m -P%@ __bu_print_drop__.pdf\r\n\0", printer] UTF8String];
+#else
+ cmd = "touch abc.def\r\n\0";
+#endif
libssh2_channel_write(channel, cmd, sizeof(char) * strlen(cmd));
[self readChannel:channel];