* Set by us for CORE protocol.
*/
int max_send = BUFFER_SIZE;
-/*
- * Size of the data we can receive. Set by us.
- * Can be modified by the max xmit parameter.
- */
-int max_recv = BUFFER_SIZE;
uint16 last_session_tag = UID_FIELD_INVALID;
int trans_num = 0;
pid_t mypid = 0;
* Set by us for CORE protocol.
*/
extern int max_send;
-/*
- * Size of the data we can receive. Set by us.
- * Can be modified by the max xmit parameter.
- */
-extern int max_recv;
extern uint16 last_session_tag;
extern int trans_num;
bool spnego;
struct auth_context *auth_context;
bool done;
+ /*
+ * Size of the data we can receive. Set by us.
+ * Can be modified by the max xmit parameter.
+ */
+ int max_recv;
} negprot;
struct smb_signing_state *signing_state;
/* Reply, SMBlockread, SMBwritelock supported. */
SCVAL(req->outbuf,smb_flg,FLAG_REPLY|FLAG_SUPPORT_LOCKREAD);
- SSVAL(req->outbuf,smb_vwv2,max_recv);
+ SSVAL(req->outbuf,smb_vwv2,sconn->smb1.negprot.max_recv);
SSVAL(req->outbuf,smb_vwv3,lp_maxmux()); /* maxmux */
SSVAL(req->outbuf,smb_vwv4,1);
SSVAL(req->outbuf,smb_vwv5,raw); /* tell redirector we support
/* Reply, SMBlockread, SMBwritelock supported. */
SCVAL(req->outbuf,smb_flg,FLAG_REPLY|FLAG_SUPPORT_LOCKREAD);
- SSVAL(req->outbuf,smb_vwv2,max_recv);
+ SSVAL(req->outbuf,smb_vwv2,sconn->smb1.negprot.max_recv);
SSVAL(req->outbuf,smb_vwv3,lp_maxmux());
SSVAL(req->outbuf,smb_vwv4,1);
SSVAL(req->outbuf,smb_vwv5,raw); /* readbraw and/or writebraw */
SSVAL(req->outbuf,smb_vwv1+1,lp_maxmux()); /* maxmpx */
SSVAL(req->outbuf,smb_vwv2+1,1); /* num vcs */
- SIVAL(req->outbuf,smb_vwv3+1,max_recv); /* max buffer. LOTS! */
+ SIVAL(req->outbuf,smb_vwv3+1,
+ sconn->smb1.negprot.max_recv); /* max buffer. LOTS! */
SIVAL(req->outbuf,smb_vwv5+1,0x10000); /* raw size. full 64k */
SIVAL(req->outbuf,smb_vwv7+1,sys_getpid()); /* session key */
SIVAL(req->outbuf,smb_vwv9+1,capabilities); /* capabilities */
#endif
- max_recv = MIN(lp_maxxmit(),BUFFER_SIZE);
+ smbd_server_conn->smb1.negprot.max_recv = MIN(lp_maxxmit(),BUFFER_SIZE);
smbd_server_conn->smb1.fde = event_add_fd(smbd_event_context(),
smbd_server_conn,
const char *p;
DATA_BLOB password_blob;
TALLOC_CTX *ctx = talloc_tos();
+ struct smbd_server_connection *sconn = smbd_server_conn;
START_PROFILE(SMBtcon);
}
reply_outbuf(req, 2, 0);
- SSVAL(req->outbuf,smb_vwv0,max_recv);
+ SSVAL(req->outbuf,smb_vwv0,sconn->smb1.negprot.max_recv);
SSVAL(req->outbuf,smb_vwv1,conn->cnum);
SSVAL(req->outbuf,smb_tid,conn->cnum);
files_struct *fsp;
struct byte_range_lock *br_lck = NULL;
char *p = NULL;
+ struct smbd_server_connection *sconn = smbd_server_conn;
START_PROFILE(SMBlockread);
* However the requested READ size IS affected by max_recv. Insanity.... JRA.
*/
- if (numtoread > max_recv) {
+ if (numtoread > sconn->smb1.negprot.max_recv) {
DEBUG(0,("reply_lockread: requested read size (%u) is greater than maximum allowed (%u). \
Returning short read of maximum allowed for compatibility with Windows 2000.\n",
- (unsigned int)numtoread, (unsigned int)max_recv ));
- numtoread = MIN(numtoread,max_recv);
+ (unsigned int)numtoread,
+ (unsigned int)sconn->smb1.negprot.max_recv));
+ numtoread = MIN(numtoread, sconn->smb1.negprot.max_recv);
}
nread = read_file(fsp,data,startpos,numtoread);
int outsize = 0;
files_struct *fsp;
struct lock_struct lock;
+ struct smbd_server_connection *sconn = smbd_server_conn;
START_PROFILE(SMBread);
/*
* The requested read size cannot be greater than max_recv. JRA.
*/
- if (numtoread > max_recv) {
+ if (numtoread > sconn->smb1.negprot.max_recv) {
DEBUG(0,("reply_read: requested read size (%u) is greater than maximum allowed (%u). \
Returning short read of maximum allowed for compatibility with Windows 2000.\n",
- (unsigned int)numtoread, (unsigned int)max_recv ));
- numtoread = MIN(numtoread,max_recv);
+ (unsigned int)numtoread,
+ (unsigned int)sconn->smb1.negprot.max_recv));
+ numtoread = MIN(numtoread, sconn->smb1.negprot.max_recv);
}
reply_outbuf(req, 5, numtoread+3);