summaryrefslogtreecommitdiffstats
path: root/servers/auth_server_lin/src/auth_conn.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-07-20 14:10:10 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-07-20 14:10:10 -0500
commit9c3d84d0df528e8463906ac6399d651792b7ade6 (patch)
tree499ef6438918f70f499fb0661ceb9c3382cf5107 /servers/auth_server_lin/src/auth_conn.cpp
parent0f3b0430e86e45b4a2fca4bc68b013c7f1b484aa (diff)
downloadulab-9c3d84d0df528e8463906ac6399d651792b7ade6.tar.gz
ulab-9c3d84d0df528e8463906ac6399d651792b7ade6.zip
Fix FPGA programmer
Diffstat (limited to 'servers/auth_server_lin/src/auth_conn.cpp')
-rw-r--r--servers/auth_server_lin/src/auth_conn.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/servers/auth_server_lin/src/auth_conn.cpp b/servers/auth_server_lin/src/auth_conn.cpp
index c9a377f..e073e12 100644
--- a/servers/auth_server_lin/src/auth_conn.cpp
+++ b/servers/auth_server_lin/src/auth_conn.cpp
@@ -275,19 +275,29 @@ int AuthSocket::servLoop() {
break;
case 4:
if (m_servClientSocket->state() == TQSocket::Connected) {
- TQ_ULONG reclen;
+ TQ_LONG reclen;
if (canReadData()) {
reclen = readBlock(m_loopBuffer.data(), m_loopBuffer.size());
- m_servClientSocket->writeBlock(m_loopBuffer.data(), reclen);
- m_servClientSocket->flush();
- transferred_data = true;
+ if (reclen > 0) {
+ m_servClientSocket->writeBlock(m_loopBuffer.data(), reclen);
+ m_servClientSocket->flush();
+ transferred_data = true;
+ }
+ else {
+ printf("[WARNING] Remote server advertised data available but no data was able to be read!\n\r");
+ }
}
if (m_servClientSocket->canReadData()) {
reclen = m_servClientSocket->readBlock(m_loopBuffer.data(), m_loopBuffer.size());
- writeBlock(m_loopBuffer.data(), reclen);
- flush();
- transferred_data = true;
+ if (reclen > 0) {
+ writeBlock(m_loopBuffer.data(), reclen);
+ flush();
+ transferred_data = true;
+ }
+ else {
+ printf("[WARNING] Remote client advertised data available but no data was able to be read!\n\r");
+ }
}
}
else {