* Source/AppController.m:
([AppController readChannel:]): Use libssh2_poll_channel_read() to check and see if there's more to read as it's much faster
([AppController uploadAndPrint:]): If BLU_DEBUG, do not LPR anything, but rather touch a file
do
{
memset(&buf, '\0', sizeof(buf));
do
{
memset(&buf, '\0', sizeof(buf));
numbytes = libssh2_channel_read(channel, buf, sizeof(buf));
numbytes = libssh2_channel_read(channel, buf, sizeof(buf));
#ifdef BLU_DEBUG
NSLog(@"buf: %s", buf);
#endif
#ifdef BLU_DEBUG
NSLog(@"buf: %s", buf);
#endif
- } while (numbytes > 0);
+ } while (libssh2_poll_channel_read(channel, 0));
[progress setHidden:NO];
[status setHidden:NO];
[progress setHidden:NO];
[status setHidden:NO];
- NSString *printer = [[printersController selection] valueForKey:@"unixName"];
FILE *localFile;
struct stat fileInfo;
FILE *localFile;
struct stat fileInfo;
[self readChannel:channel];
// send the job to lpr
[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];
libssh2_channel_write(channel, cmd, sizeof(char) * strlen(cmd));
[self readChannel:channel];