From a4bc522a7292f3bb87740e87df8449ba0ea6be10 Mon Sep 17 00:00:00 2001 From: Matthew Chapman Date: Sun, 21 Mar 1999 13:01:31 +0000 Subject: The line: this_pdu_data_pos = data_pos - p->prev_pdu_file_offset; is correct for first two PDU's only, after that it results in extra garbage after each fragment and hence "Protocol Error" messages from NT4 SP4. Changed to: this_pdu_data_pos = (pdu_data_sent == 0) ? 0 : (pdu_data_sent - 0x18); (This used to be commit b9e8a3ef3a25a81c4bb125bdd4f4d8334a578c85) --- source3/rpc_server/srv_pipe_hnd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index 27aa79381c..531fcf6add 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -230,8 +230,8 @@ int read_pipe(pipes_struct *p, char *data, uint32 pos, int n) /* the read request starts from where the SMBtrans2 left off. */ data_pos = p->file_offset - p->hdr_offsets; - this_pdu_data_pos = data_pos - p->prev_pdu_file_offset; pdu_data_sent = p->file_offset - p->prev_pdu_file_offset; + this_pdu_data_pos = (pdu_data_sent == 0) ? 0 : (pdu_data_sent - 0x18); if (!IS_BITS_SET_ALL(p->hdr.flags, RPC_FLG_LAST)) { @@ -255,7 +255,7 @@ int read_pipe(pipes_struct *p, char *data, uint32 pos, int n) } pdu_len = mem_buf_len(p->rhdr.data); - num = pdu_len - (int)this_pdu_data_pos; + num = pdu_len - this_pdu_data_pos; DEBUG(6,("read_pipe: pdu_len: %d num: %d n: %d\n", pdu_len, num, n)); -- cgit