DataReady not returning enough (General questions)
I am running into a problem at a single customer using the SSH ActiveX component. We are successfully connecting via uid/privkey and sending a shell script to ESX 4.0, but DataReady is not returning enough to continue.
I've tried to explain the problem in pseudo-code. As you can see we are not continuing until DataReady is more than our command length. So, because DataReady only returns 17 it loops endlessly.
Please advise.
sCommand = if [ -e /etc/vmware-release ]; then RELFILE=/etc/vmware-release; OSVER=`sed -e 's/[^[:digit:]]*//' -e 's/[ ]*(.*//' $RELFILE`; OSNAME=`sed -e 's/[ ]*[[:digit:]].*//' $RELFILE`;elif [ -e /proc/vmware/version ]; then RELFILE=/proc/vmware/version; OSVER=`sed -n '1p' $RELFILE | sed -e 's/.*Server[ ]*//' -e 's/[ ]*[.*//'`; OSNAME=`sed -n -e '1s/[ ]*[[:digit:]].*//p' $RELFILE`;else OSVER= Unknown ; OSNAME= Unknown ;fi;echo -n $OSNAME $OSVER ; echo -e 0000
ISSH.Send(sCommand)
eState = Sending
do
{
eState = ISSH.State(sCommand)
Sleep(1000)
}
while(eState == Sending)
// State == Connected
lDataReady = 0
do
{
lDataReady = ISSH.DataReady()
// first call returns 0
// second call returns 17
if(0 == lDataReady || lDataReady < sCommand.length())
lDataReady = 0
}
while(lDataReady == 0)
...