added default to switch

pull/12/head
Tom Early 7 years ago
parent 48380cc587
commit 8e340ca905

@ -239,11 +239,10 @@ void CQnetITAP::Run(const char *cfgfile)
// there is something to read! // there is something to read!
unsigned char buf[100]; unsigned char buf[100];
ssize_t len;
if (keep_running && FD_ISSET(serfd, &readfds)) { if (keep_running && FD_ISSET(serfd, &readfds)) {
lastdata = std::chrono::steady_clock::now(); lastdata = std::chrono::steady_clock::now();
switch(GetITAPData(buf) { switch (GetITAPData(buf)) {
case RT_ERROR: case RT_ERROR:
keep_running = false; keep_running = false;
break; break;
@ -258,12 +257,14 @@ void CQnetITAP::Run(const char *cfgfile)
is_alive = true; is_alive = true;
} }
break; break;
default:
break;
} }
FD_CLR(serfd, &readfds); FD_CLR(serfd, &readfds);
} }
if (keep_running && FD_ISSET(ug2m, &readfds)) { if (keep_running && FD_ISSET(ug2m, &readfds)) {
len = Gate2Modem.Read(buf, 100); ssize_t len = Gate2Modem.Read(buf, 100);
if (len < 0) { if (len < 0) {
printf("ERROR: Run: recvfrom(gsock) returned error %d, %s\n", errno, strerror(errno)); printf("ERROR: Run: recvfrom(gsock) returned error %d, %s\n", errno, strerror(errno));

Loading…
Cancel
Save

Powered by TurnKey Linux.