Re: Bidirectional transfer on the same channel

Andrea Campi <[email protected]> Fri, 8 Nov 2002 13:00:54 +0100
Newsgroups gmane.network.beep.roadrunner.general
Organization I.NET S.p.A.
Message-ID <[email protected]>
On Thu, Nov 07, 2002 at 07:24:10PM +0100, Jonas Borgstr?m wrote:
> Andrea Campi <[email protected]> writes:
> 
> Can you try this patch and see if it works?
> 
> http://afs.codefactory.se/~jonas/roadrunner-reorder.diff
> 
> please note that this patch breaks binary compatibility with RRMessage
> derived classes.
> 

That's fine, thanks. However, I think this patch is needed for anti
foot-shooting if nothing else:


--- librr/rr-channel.c.orig	Fri Nov  8 12:48:42 2002
+++ librr/rr-channel.c	Fri Nov  8 12:58:24 2002
@@ -195,10 +195,16 @@
 	if (RR_IS_MESSAGE (object)) {
 		RRMessage *message = RR_MESSAGE (object);
 
-		if (message->msgno < 0) {
-			message->msgno = channel->msgno++;
-			if (channel->msgno < 0)
-				channel->msgno = 0;
+		if (message->type == RR_FRAME_TYPE_MSG) {
+			if (message->msgno < 0) {
+				message->msgno = channel->msgno++;
+				if (channel->msgno < 0)
+					channel->msgno = 0;
+			}
+		} else {
+			if (message->msgno < 0) {
+				/* Do something, this can't be right! */
+			}
 		}
 		out_queue_push (&channel->out_queue, object, message->msgno,
 				message->type);



Bye,
	Andrea
-- 
Andrea Campi                              mailto:[email protected]
I.NET S.p.A. - BT Ignite                  http://www.inet.it
Technical Dept. - R&D			  phone: +39 02 32863 ext 1
v. Darwin, 85 - I-20019			  fax: +39 02 32863 ext 7705
Settimo Milanese (MI), Italy