Rev 365: another place where we could send a partial packet in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Sun May 27 22:37:54 GMT 2007


------------------------------------------------------------
revno: 365
revision-id: tridge at samba.org-20070527223754-wb7q9bje7rd7dfxi
parent: tridge at samba.org-20070527145110-4dwpd6btx287elvc
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Mon 2007-05-28 08:37:54 +1000
message:
  another place where we could send a partial packet
modified:
  common/ctdb_io.c               ctdb_io.c-20070409200335-dzfc7f3rra5rcf60-1
=== modified file 'common/ctdb_io.c'
--- a/common/ctdb_io.c	2007-05-26 06:41:32 +0000
+++ b/common/ctdb_io.c	2007-05-27 22:37:54 +0000
@@ -225,7 +225,7 @@
 int ctdb_queue_send(struct ctdb_queue *queue, uint8_t *data, uint32_t length)
 {
 	struct ctdb_queue_pkt *pkt;
-	uint32_t length2;
+	uint32_t length2, full_length;
 
 	if (queue->alignment) {
 		/* enforce the length and alignment rules from the tcp packet allocator */
@@ -238,6 +238,8 @@
 	if (length2 != length) {
 		memset(data+length, 0, length2-length);
 	}
+
+	full_length = length2;
 	
 	/* if the queue is empty then try an immediate write, avoiding
 	   queue overhead. This relies on non-blocking sockets */
@@ -268,7 +270,7 @@
 	CTDB_NO_MEMORY(queue->ctdb, pkt->data);
 
 	pkt->length = length2;
-	pkt->full_length = length2;
+	pkt->full_length = full_length;
 
 	if (queue->out_queue == NULL && queue->fd != -1) {
 		EVENT_FD_WRITEABLE(queue->fde);



More information about the samba-cvs mailing list