[Spread-cvs] cvs commit: spread/daemon Readme.txt flow_control.c network.c
jonathan at spread.org
jonathan at spread.org
Sun Jan 25 15:27:52 EST 2004
jonathan 04/01/25 15:27:52
Modified: daemon Readme.txt flow_control.c network.c
Log:
Improve network.c Net_ucast, _bcast, _flush_bcast so they report packet
sent to caller even if not actual DL_ send is needed. This allows higher
level to accurate flow control the number of packets sent in Send_new_packets()
and fixes a crash reported by David Shaw when a singleton daemon configuration
has a client send very large messages to it.
Revision Changes Path
1.40 +2 -1 spread/daemon/Readme.txt
Index: Readme.txt
===================================================================
RCS file: /storage/cvsroot/spread/daemon/Readme.txt,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- Readme.txt 12 Nov 2003 22:11:03 -0000 1.39
+++ Readme.txt 25 Jan 2004 20:27:52 -0000 1.40
@@ -60,7 +60,8 @@
*) Minor fix to Mac OS X compilation so library softlinks do not fail the
second time make is run.
*) Alarm() changes to support priority levels on each Alarm() call.
-
+*) Fix crash by improving packet accounting when a client connected to a
+ singleton daemon sends a large broadcast. Reported by David Shaw.
June 20, 2003 Ver 3.17.1
----------------------------
1.3 +1 -1 spread/daemon/flow_control.c
Index: flow_control.c
===================================================================
RCS file: /storage/cvsroot/spread/daemon/flow_control.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- flow_control.c 22 Sep 2002 02:56:52 -0000 1.2
+++ flow_control.c 25 Jan 2004 20:27:52 -0000 1.3
@@ -65,7 +65,7 @@
int allowed;
if( Memb_state() == EVS ) return( 0 );
- if( Highest_seq > Aru + MAX_SEQ_GAP ) return( 0 );
+ if( Highest_seq > (Aru + MAX_SEQ_GAP) ) return( 0 );
allowed = Window + Personal_window - flow_control;
if (allowed < 0) allowed = 0;
if (allowed > Window) allowed = Window;
1.10 +17 -2 spread/daemon/network.c
Index: network.c
===================================================================
RCS file: /storage/cvsroot/spread/daemon/network.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- network.c 16 Jul 2003 20:44:32 -0000 1.9
+++ network.c 25 Jan 2004 20:27:52 -0000 1.10
@@ -246,6 +246,10 @@
{
ret = DL_send( Send_channel, Bcast_address, Bcast_port, scat );
}
+
+ if( !Bcast_needed && (Num_send_needed == 0) )
+ ret = 1; /* No actual send is needed, but 'packet' can be considered 'sent' */
+
return( ret );
}
@@ -347,6 +351,10 @@
{
ret = DL_send( Send_channel, Bcast_address, Bcast_port, &Queue_scat );
}
+
+ if( !Bcast_needed && (Num_send_needed == 0) )
+ ret = 1; /* No actual send is needed, but 'packet' can be considered 'sent' */
+
Queue_scat.num_elements = 0;
Queued_bytes = 0;
return( ret );
@@ -356,6 +364,7 @@
{
packet_header *pack_ptr;
int ret;
+ bool send_not_needed_p = FALSE;
ret = 0;
pack_ptr = (packet_header *)scat->elements[0].buf;
@@ -366,7 +375,8 @@
if( Bcast_needed )
{
ret = DL_send( Send_channel, Bcast_address, Bcast_port, scat );
- }
+ } else
+ send_not_needed_p = TRUE;
}else{
if( Net_membership.segments[seg_index].num_procs > 0 )
{
@@ -376,8 +386,13 @@
Net_membership.segments[seg_index].port,
scat );
pack_ptr->type = Clear_routed( pack_ptr->type );
- }
+ } else
+ send_not_needed_p = TRUE;
}
+
+ if (send_not_needed_p)
+ ret = 1; /* notify that packet can be considered sent, even though no network send actually needed */
+
return( ret );
}
More information about the Spread-cvs
mailing list