rpcrt4: Fix the sending of >5800 byte messages by only adding offset

to the buffer after the first batch of data has been written to the
pipe.
This commit is contained in:
Robert Shearman 2006-01-18 11:29:38 +01:00 committed by Alexandre Julliard
parent b4fe7ea7c6
commit a4000349f8
1 changed files with 3 additions and 3 deletions

View File

@ -254,15 +254,13 @@ RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header,
hdr_size = Header->common.frag_len; hdr_size = Header->common.frag_len;
Header->common.flags |= RPC_FLG_FIRST; Header->common.flags |= RPC_FLG_FIRST;
Header->common.flags &= ~RPC_FLG_LAST; Header->common.flags &= ~RPC_FLG_LAST;
while (!(Header->common.flags & RPC_FLG_LAST)) { while (!(Header->common.flags & RPC_FLG_LAST)) {
/* decide if we need to split the packet into fragments */ /* decide if we need to split the packet into fragments */
if ((BufferLength + hdr_size) <= Connection->MaxTransmissionSize) { if ((BufferLength + hdr_size) <= Connection->MaxTransmissionSize) {
Header->common.flags |= RPC_FLG_LAST; Header->common.flags |= RPC_FLG_LAST;
Header->common.frag_len = BufferLength + hdr_size; Header->common.frag_len = BufferLength + hdr_size;
} else { } else {
Header->common.frag_len = Connection->MaxTransmissionSize; Header->common.frag_len = Connection->MaxTransmissionSize;
buffer_pos += Header->common.frag_len - hdr_size;
BufferLength -= Header->common.frag_len - hdr_size;
} }
/* transmit packet header */ /* transmit packet header */
@ -283,6 +281,8 @@ RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header,
return GetLastError(); return GetLastError();
} }
buffer_pos += Header->common.frag_len - hdr_size;
BufferLength -= Header->common.frag_len - hdr_size;
Header->common.flags &= ~RPC_FLG_FIRST; Header->common.flags &= ~RPC_FLG_FIRST;
} }