[net.bugs.uucp] uucico misses OO messages

ado@elsie.UUCP (Arthur David Olson) (09/15/84)

Apologies if this is the fifth time around the net for this.
And if anyone has wiser words on the subject, let me and others know!

Subject--	imsg.c

Problem--	uucico can miss "OO" messages.
		Since uucico eventually times out, the only bad thing about this
		is that a phone line gets tied up until the timeout occurs.

Repeat by--	Pick another system.  Ensure that there's no work in your
		uucp directory for the other system, and that there's no
		work in the other system's uucp directory for your system.
		Use the comand
			/usr/lib/uucp/uucico -r1 -x9 -sothersys >& /tmp/# &
		Then look at the file "/tmp/#"
		If you see something like
			--*!----*"---"*----"*---OOOOOO-imsg >-
			exit code 0
		at the end of the file, it means you've got the problem--
		there was an "imsg" (Input MeSsaGe) call at the end of the
		uucico session that never completed.
		If, on the other hand, the end of the file looks something like
			OOOOOO-
			exit code 0
		you're okay.

		N.B.:  I've seen this problem on our 4.1bsd system when calling
		4.2bsd systems; it may only occur on this system combination.

Discussion--	The papers "A Dial-Up Network of UNIX (tm) Systems" and
		"Uucp Implementation Description" both state that:
			When a HY message is received by the MASTER it is
			echoed back to the SLAVE and the protocols are turned
			off.  Each program sends a final "OO" message to the
			other.

		Alas, after
			the MASTER sends a H message and
			the SLAVE sends a HY message and
			the MASTER receives the HY message and
			the master echoes back the HY message,
		the SLAVE does not immediately turn off the protocol but rather
		first sends out a second HY message.  It's this second HY
		message that (at least in part) accounts for the characters
		preceding "OOOOOO" in the line that looks like
			--*!----*"---"*----"*---OOOOOO-imsg >-
		in the "uucico" diagnostic output file.  The presence of these
		characters causes "imsg" to miss the "OO" message.

Fix--		Here are the relevant lines from "imsg.c"--the idea is to
		always be on the lookout for uucp's "message synchronization"
		character, "rewinding" the message buffer
		if it is seen.

		...

		#ifdef OLDVERSION
		imsg(msg, fn)
		char *msg;
		int fn;
		{
		#else
		imsg(amsg, fn)
		char *	amsg;
		int	fn;
		{
			register char *	msg = amsg;
		#endif
		
		...

		#ifndef OLDVERSION
				if (*msg == Msync[0]) {
					msg = amsg;
					continue;
				}
		#endif
				if (*msg == '\n')
					break;

		...

--
UNIX is an AT&T Bell Laboratories trademark.
--
	...decvax!seismo!umcp-cs!elsie!ado	(301) 496-5688
	(DEC, VAX and Elsie are Digital Equipment Corp. and Borden's trademarks)