moved irc data thread priorities in process loop.

lastudp
Tom Early 7 years ago
parent 3b53e36b8c
commit 0406bf552f

@ -392,7 +392,7 @@ bool CQnetGateway::read_config(char *cfgFile)
if (! get_value(cfg, path+"status", status_file, 2, FILENAME_MAX, "/usr/local/etc/RPTR_STATUS.txt")) if (! get_value(cfg, path+"status", status_file, 2, FILENAME_MAX, "/usr/local/etc/RPTR_STATUS.txt"))
return true; return true;
if (! get_value(cfg, path+"qnvoicefile", qnvoicefile, 2, FILENAME_MAX, ".tmp/qnvoice.txt")) if (! get_value(cfg, path+"qnvoicefile", qnvoicefile, 2, FILENAME_MAX, "/tmp/qnvoice.txt"))
return true; return true;
// link // link
@ -486,31 +486,32 @@ void CQnetGateway::GetIRCDataThread()
not_announced[i] = this->rptr.mod[i].defined; // announce to all modules that are defined! not_announced[i] = this->rptr.mod[i].defined; // announce to all modules that are defined!
bool is_quadnet = (0 == ircddb.ip.compare("rr.openquad.net")); bool is_quadnet = (0 == ircddb.ip.compare("rr.openquad.net"));
while (keep_running) { while (keep_running) {
threshold++; int rc = ii->getConnectionState();
if (threshold >= 100) { if (rc > 5 && rc < 8 && is_quadnet) {
int rc = ii->getConnectionState(); char ch = '\0';
if (rc > 5 && rc < 8 && is_quadnet) { if (not_announced[0])
char ch = '\0'; ch = 'A';
if (not_announced[0]) else if (not_announced[1])
ch = 'A'; ch = 'B';
else if (not_announced[1]) else if (not_announced[2])
ch = 'B'; ch = 'C';
else if (not_announced[2]) if (ch) {
ch = 'C'; // we need to announce, but can we?
if (ch) { struct stat sbuf;
// we need to announce, but can we? if (stat(qnvoicefile.c_str(), &sbuf)) {
struct stat sbuf; // yes, there is no qnvoicefile, so create it
if (stat(qnvoicefile.c_str(), &sbuf)) { FILE *fp = fopen(qnvoicefile.c_str(), "w");
// yes, there is no qnvoicefile, so create it if (fp) {
FILE *fp = fopen(qnvoicefile.c_str(), "w"); fprintf(fp, "%c_connected2network.dat_WELCOME_TO_QUADNET", ch);
if (fp) { fclose(fp);
fprintf(fp, "%c_connected2network.dat_WELCOME_TO_QUADNET", ch); not_announced[ch - 'A'] = false;
fclose(fp); } else
not_announced[ch - 'A'] = false; fprintf(stderr, "could not open %s\n", qnvoicefile.c_str());
}
}
} }
} }
}
threshold++;
if (threshold >= 100) {
if ((rc == 0) || (rc == 10)) { if ((rc == 0) || (rc == 10)) {
if (last_status != 0) { if (last_status != 0) {
printf("irc status=%d, probable disconnect...\n", rc); printf("irc status=%d, probable disconnect...\n", rc);

Loading…
Cancel
Save

Powered by TurnKey Linux.