Warn if we never received a valid line from an external script.

git-svn-id: http://yate.null.ro/svn/yate/trunk@2691 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2009-06-08 10:56:01 +00:00
parent 32d4a4030f
commit 00105b6b53
1 changed files with 5 additions and 0 deletions

View File

@ -1052,6 +1052,7 @@ void ExtModReceiver::run()
Debug("ExtModule",DebugWarn,"Failed to set nonblocking mode, expect trouble [%p]",this);
char buffer[MAX_INCOMING_LINE];
int posinbuf = 0;
bool invalid = true;
DDebug(DebugAll,"ExtModReceiver::run() entering loop [%p]",this);
for (;;) {
use();
@ -1065,6 +1066,9 @@ void ExtModReceiver::run()
Debug("ExtModule",DebugInfo,"Read EOF on %p [%p]",m_in,this);
closeIn();
flush();
if (invalid)
Debug("ExtModule",DebugWarn,"Never got anything valid from '%s' '%s'",
m_script.c_str(),m_args.safe());
if (m_chan && m_chan->running())
Thread::sleep(1);
break;
@ -1092,6 +1096,7 @@ void ExtModReceiver::run()
if ((eoline > buffer) && (eoline[-1] == '\r'))
eoline[-1] = 0;
if (buffer[0]) {
invalid = invalid && (buffer[0] != '%' || buffer[1] != '%');
use();
bool goOut = processLine(buffer);
if (unuse() || goOut)