From bb373dbd6c1d68d42d664351ee36f5ca4a9272c6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 11 Aug 2007 11:20:21 +0000 Subject: r24325: Push down reply_prep_legacy in reply_read_and_X (This used to be commit 9d2354129dad1d4d015d463f138a196f9f72af2f) --- source3/smbd/reply.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index cf30c183fa..7b981e1c8a 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2900,20 +2900,12 @@ void reply_read_and_X(connection_struct *conn, struct smb_request *req) return; } - if (!reply_prep_legacy(req, &inbuf, &outbuf, &length, &bufsize)) { - reply_nterror(req, NT_STATUS_NO_MEMORY); - END_PROFILE(SMBreadX); - return; - } - - set_message(inbuf,outbuf,12,0,True); - if (global_client_caps & CAP_LARGE_READX) { - size_t upper_size = SVAL(inbuf,smb_vwv7); + size_t upper_size = SVAL(req->inbuf,smb_vwv7); smb_maxcnt |= (upper_size<<16); if (upper_size > 1) { /* Can't do this on a chained packet. */ - if ((CVAL(inbuf,smb_vwv0) != 0xFF)) { + if ((CVAL(req->inbuf,smb_vwv0) != 0xFF)) { reply_nterror(req, NT_STATUS_NOT_SUPPORTED); END_PROFILE(SMBreadX); return; @@ -2935,12 +2927,12 @@ void reply_read_and_X(connection_struct *conn, struct smb_request *req) } } - if(CVAL(inbuf,smb_wct) == 12) { + if (req->wct == 12) { #ifdef LARGE_SMB_OFF_T /* * This is a large offset (64 bit) read. */ - startpos |= (((SMB_OFF_T)IVAL(inbuf,smb_vwv10)) << 32); + startpos |= (((SMB_OFF_T)IVAL(req->inbuf,smb_vwv10)) << 32); #else /* !LARGE_SMB_OFF_T */ @@ -2948,10 +2940,10 @@ void reply_read_and_X(connection_struct *conn, struct smb_request *req) * Ensure we haven't been sent a >32 bit offset. */ - if(IVAL(inbuf,smb_vwv10) != 0) { + if(IVAL(req->inbuf,smb_vwv10) != 0) { DEBUG(0,("reply_read_and_X - large offset (%x << 32) " "used and we don't support 64 bit offsets.\n", - (unsigned int)IVAL(inbuf,smb_vwv10) )); + (unsigned int)IVAL(req->inbuf,smb_vwv10) )); END_PROFILE(SMBreadX); reply_doserror(req, ERRDOS, ERRbadaccess); return; @@ -2968,6 +2960,14 @@ void reply_read_and_X(connection_struct *conn, struct smb_request *req) return; } + if (!reply_prep_legacy(req, &inbuf, &outbuf, &length, &bufsize)) { + reply_nterror(req, NT_STATUS_NO_MEMORY); + END_PROFILE(SMBreadX); + return; + } + + set_message(inbuf,outbuf,12,0,True); + if (!big_readX && schedule_aio_read_and_X(conn, inbuf, outbuf, length, bufsize, fsp, startpos, smb_maxcnt)) { -- cgit