mirror of https://github.com/macssh/macssh.git
fixed broken keygen
This commit is contained in:
parent
bc633a75e8
commit
54e7f590e3
|
@ -25,6 +25,8 @@
|
||||||
#include "netevent.proto.h"
|
#include "netevent.proto.h"
|
||||||
#include "network.proto.h"
|
#include "network.proto.h"
|
||||||
|
|
||||||
|
#include "GUSITTY.h"
|
||||||
|
|
||||||
#include <GUSIInternal.h>
|
#include <GUSIInternal.h>
|
||||||
#include <GUSIBasics.h>
|
#include <GUSIBasics.h>
|
||||||
#include <GUSIContext.h>
|
#include <GUSIContext.h>
|
||||||
|
@ -171,6 +173,43 @@ GUSISIOUXSocket::GUSISIOUXSocket()
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* default GUSISIOUXSocket::select checks for keyDown or
|
||||||
|
* autoKey events from MacOS's EventQueue.
|
||||||
|
* we use an internal buffer.
|
||||||
|
*/
|
||||||
|
|
||||||
|
class GUSISIOUXSocket : public GUSISocket {
|
||||||
|
public:
|
||||||
|
~GUSISIOUXSocket();
|
||||||
|
|
||||||
|
ssize_t read(const GUSIScatterer & buffer);
|
||||||
|
ssize_t write(const GUSIGatherer & buffer);
|
||||||
|
virtual int ioctl(unsigned int request, va_list arg);
|
||||||
|
virtual int fstat(struct stat * buf);
|
||||||
|
virtual int isatty();
|
||||||
|
bool select(bool * canRead, bool * canWrite, bool *);
|
||||||
|
|
||||||
|
static GUSISIOUXSocket * Instance();
|
||||||
|
private:
|
||||||
|
static GUSISIOUXSocket * sInstance;
|
||||||
|
|
||||||
|
GUSISIOUXSocket();
|
||||||
|
};
|
||||||
|
|
||||||
|
bool GUSISIOUXSocket::select(bool * canRead, bool * canWrite, bool *)
|
||||||
|
{
|
||||||
|
bool cond = false;
|
||||||
|
|
||||||
|
if (canRead) {
|
||||||
|
if (*canRead = (AvailableFromTTY(0, (lshcontext *)pthread_getspecific(ssh2threadkey))))
|
||||||
|
cond = true;
|
||||||
|
}
|
||||||
|
if (canWrite)
|
||||||
|
cond = *canWrite = true;
|
||||||
|
return cond;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* default GUSIProcess::Yield has 20 ticks to remain in same state
|
* default GUSIProcess::Yield has 20 ticks to remain in same state
|
||||||
* we use 0.
|
* we use 0.
|
||||||
|
|
|
@ -94,8 +94,9 @@ long WriteCharsToConsole(char *buffer, long n)
|
||||||
/* since we redirect stdin/out/err to our 'sockets'
|
/* since we redirect stdin/out/err to our 'sockets'
|
||||||
* this shouldn't occur ! (or lsh calls printf ? (; )
|
* this shouldn't occur ! (or lsh calls printf ? (; )
|
||||||
*/
|
*/
|
||||||
DebugStr("\pWriteCharsToConsole");
|
// DebugStr("\pWriteCharsToConsole");
|
||||||
return n;
|
// return n;
|
||||||
|
return WriteCharsToTTY(1, pthread_getspecific(ssh2threadkey), buffer, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -116,8 +117,9 @@ long ReadCharsFromConsole(char *buffer, long n)
|
||||||
/* since we redirect stdin/out/err to our 'sockets'
|
/* since we redirect stdin/out/err to our 'sockets'
|
||||||
* this shouldn't occur ! (or lsh calls printf ? (; )
|
* this shouldn't occur ! (or lsh calls printf ? (; )
|
||||||
*/
|
*/
|
||||||
DebugStr("\pReadCharsFromConsole");
|
// DebugStr("\pReadCharsFromConsole");
|
||||||
return 0;
|
// return 0;
|
||||||
|
return ReadCharsFromTTY(0, pthread_getspecific(ssh2threadkey), buffer, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue