From 69980a9469f5a2567239ea6389eca6adb77295bc Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Sat, 16 Mar 2002 23:47:43 +0000 Subject: - ncpd: Now it's possible to change Series3/5 without restarting ncpd --- ncpd/link.cc | 5 +++-- ncpd/ncp.cc | 10 ++++++++++ ncpd/packet.cc | 10 ++++++---- 3 files changed, 19 insertions(+), 6 deletions(-) (limited to 'ncpd') diff --git a/ncpd/link.cc b/ncpd/link.cc index 025e131..19f7094 100644 --- a/ncpd/link.cc +++ b/ncpd/link.cc @@ -98,7 +98,6 @@ retransTimeout() void Link:: reset() { - p->reset(); txSequence = 1; rxSequence = -1; failed = false; @@ -108,7 +107,7 @@ reset() { purgeAllQueues(); for (int i = 0; i < 256; i++) xoff[i] = false; - + p->reset(); // submit a link request sendReqReq(); } @@ -335,6 +334,7 @@ receive(bufferStore buff) rxSequence = 0; txSequence = 1; purgeAllQueues(); + p->setEpoc(false); if (verbose & LNK_DEBUG_LOG) cout << "Link: 1-linkType set to " << linkType << endl; } @@ -444,6 +444,7 @@ receive(bufferStore buff) rxSequence = 0; txSequence = 1; // Our ReqReq was seq 0 purgeAllQueues(); + p->setEpoc(false); sendAck(rxSequence); } } diff --git a/ncpd/ncp.cc b/ncpd/ncp.cc index f20ca75..1780826 100644 --- a/ncpd/ncp.cc +++ b/ncpd/ncp.cc @@ -257,6 +257,16 @@ decodeControlMessage(bufferStore & buff) cout << "ncp: REJECT client connect" << endl; } controlChannel(localChan, NCON_MSG_CONNECT_RESPONSE, b); + + // Create linkchan if it does not yet exist + if (!lChan) { + if (verbose & NCP_DEBUG_LOG) + cout << "ncp: new active linkChan" << endl; + channelPtr[localChan] = + lChan = new linkChan(this, -1); + lChan->setVerbose(verbose); + } + } break; diff --git a/ncpd/packet.cc b/ncpd/packet.cc index 1d3183b..b08b745 100644 --- a/ncpd/packet.cc +++ b/ncpd/packet.cc @@ -201,6 +201,7 @@ packet:: { if (fd != -1) { pthread_cancel(datapump); + pthread_join(datapump, NULL); ser_exit(fd); } fd = -1; @@ -212,8 +213,10 @@ packet:: void packet:: reset() { - if (fd != -1) + if (fd != -1) { pthread_cancel(datapump); + pthread_join(datapump, NULL); + } outRead = outWrite = 0; internalReset(); if (fd != -1) @@ -229,7 +232,7 @@ internalReset() ser_exit(fd); fd = -1; } - usleep(1000000); + usleep(100000); inRead = inWrite = 0; esc = false; lastFatal = false; @@ -499,13 +502,12 @@ linkFailed() #endif ) { failed = true; - justStarted = true; } if ((verbose & PKT_DEBUG_LOG) && lastFatal) cout << "packet: linkFATAL\n"; if ((verbose & PKT_DEBUG_LOG) && failed) cout << "packet: linkFAILED\n"; - return lastFatal || failed; + return (lastFatal || failed); } /* -- cgit v1.2.3