Skip to content

Commit 6363ea1

Browse files
committed
Keep track of RFNM messages.
1 parent 9a3c05c commit 6363ea1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ncp.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ static struct
8787
#define HOST_ALIVE 0001
8888

8989
client_t echo;
90+
int outstanding_rfnm;
9091
} hosts[256];
9192

9293
static const char *type_name[] =
@@ -188,6 +189,9 @@ static void send_imp (int flags, int type, int destination, int link, int id,
188189
}
189190
#endif
190191

192+
if (type == IMP_REGULAR)
193+
hosts[destination].outstanding_rfnm++;
194+
191195
imp_send_message (packet, words);
192196
}
193197

@@ -833,8 +837,10 @@ static void process_imp_nop (uint8_t *packet, int length)
833837

834838
static void process_rfnm (uint8_t *packet, int length)
835839
{
840+
uint8_t host = packet[1];
836841
fprintf (stderr, "NCP: Ready for next message to host %03o link %u.\n",
837-
packet[1], packet[2]);
842+
host, packet[2]);
843+
hosts[host].outstanding_rfnm--;
838844
}
839845

840846
static void process_full (uint8_t *packet, int length)

0 commit comments

Comments
 (0)