From ac9c6994e02ff0a204a19931c4c118c5f1028479 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 4 Jan 2000 15:59:57 +0000 Subject: using read_with_timeout(), min data size 16 bytes (DCE/RPC header), max size of SMBtrans response, timeout of 10 seconds. read_data() _certainly_ doesn't work, as you don't know what size of the data is going to come back that needs to be fed back in the SMBtrans response. yes, oops :-) (This used to be commit 70d6f7635776bba98c9c09405eff6c2087dac590) --- source3/rpc_server/srv_pipe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index 49733b0767..f8439de9a7 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -68,7 +68,11 @@ BOOL readwrite_pipe(pipes_struct *p, char *data, int len, { return False; } - (*rlen) = read_data(p->m->fd, (*rdata), (*rlen)); + + /* read a minimum of an rpc header, then wait for up to 10 seconds + * to read up to a maximum of the SMBtrans max data size + */ + (*rlen) = read_with_timeout(p->m->fd, (*rdata), 16, (*rlen), 10000); if ((*rlen) < 0) { return False; -- cgit