#define CHECK_TYPES 0
extern int DEBUGLEVEL;
-extern int maxxmit;
+extern int max_send;
extern files_struct Files[];
extern connection_struct Connections[];
int tot_data=0,tot_param=0;
int align;
- this_lparam = MIN(lparam,maxxmit - (500+lsetup*SIZEOFWORD)); /* hack */
- this_ldata = MIN(ldata,maxxmit - (500+lsetup*SIZEOFWORD+this_lparam));
+ this_lparam = MIN(lparam,max_send - (500+lsetup*SIZEOFWORD)); /* hack */
+ this_ldata = MIN(ldata,max_send - (500+lsetup*SIZEOFWORD+this_lparam));
align = (this_lparam%4);
while (tot_data < ldata || tot_param < lparam)
{
- this_lparam = MIN(lparam-tot_param,maxxmit - 500); /* hack */
- this_ldata = MIN(ldata-tot_data,maxxmit - (500+this_lparam));
+ this_lparam = MIN(lparam-tot_param,max_send - 500); /* hack */
+ this_ldata = MIN(ldata-tot_data,max_send - (500+this_lparam));
align = (this_lparam%4);
/* look in server.c for some explanation of these variables */
extern int Protocol;
extern int DEBUGLEVEL;
-extern int maxxmit;
extern int chain_fnum;
extern char magic_char;
extern connection_struct Connections[];
/* look in server.c for some explanation of these variables */
extern int Protocol;
extern int DEBUGLEVEL;
-extern int maxxmit;
+extern int max_send;
+extern int max_recv;
extern int chain_fnum;
extern char magic_char;
extern connection_struct Connections[];
return(connection_error(inbuf,outbuf,connection_num));
outsize = set_message(outbuf,2,0,True);
- SSVAL(outbuf,smb_vwv0,maxxmit);
+ SSVAL(outbuf,smb_vwv0,max_recv);
SSVAL(outbuf,smb_vwv1,connection_num);
SSVAL(outbuf,smb_tid,connection_num);
SSVAL(inbuf,smb_uid,sess_vuid);
if (!done_sesssetup)
- maxxmit = MIN(maxxmit,smb_bufsize);
+ max_send = MIN(max_send,smb_bufsize);
+
+ DEBUG(0,(" Client requested max send size of %d\n", max_send));
done_sesssetup = True;
extern int Protocol;
-int maxxmit = BUFFER_SIZE;
+/*
+ * Size of data we can send to client. Set
+ * by the client for all protocols above CORE.
+ * 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;
/* a fnum to use when chaining */
int chain_fnum = -1;
}
CVAL(outbuf,smb_flg) = 0x81; /* Reply, SMBlockread, SMBwritelock supported */
- SSVAL(outbuf,smb_vwv2,maxxmit);
+ SSVAL(outbuf,smb_vwv2,max_recv);
SSVAL(outbuf,smb_vwv3,lp_maxmux()); /* maxmux */
SSVAL(outbuf,smb_vwv4,1);
SSVAL(outbuf,smb_vwv5,raw); /* tell redirector we support
}
CVAL(outbuf,smb_flg) = 0x81; /* Reply, SMBlockread, SMBwritelock supported */
- SSVAL(outbuf,smb_vwv2,maxxmit);
+ SSVAL(outbuf,smb_vwv2,max_recv);
SSVAL(outbuf,smb_vwv3,lp_maxmux());
SSVAL(outbuf,smb_vwv4,1);
SSVAL(outbuf,smb_vwv5,raw); /* readbraw and/or writebraw */
if (msg_type == 0)
show_msg(InBuffer);
- nread = construct_reply(InBuffer,OutBuffer,nread,maxxmit);
+ nread = construct_reply(InBuffer,OutBuffer,nread,max_send);
if(nread > 0) {
if (CVAL(OutBuffer,0) == 0)
/* possibly reload the services file. */
reload_services(True);
- maxxmit = MIN(lp_maxxmit(),BUFFER_SIZE);
+ max_recv = MIN(lp_maxxmit(),BUFFER_SIZE);
if (*lp_rootdir())
{
static int send_trans2_replies(char *outbuf, int bufsize, char *params,
int paramsize, char *pdata, int datasize)
{
- /* As we are using a protocol > LANMAN1 then the maxxmit
+ /* As we are using a protocol > LANMAN1 then the max_send
variable must have been set in the sessetupX call.
This takes precedence over the max_xmit field in the
global struct. These different max_xmit variables should
be merged as this is now too confusing */
- extern int maxxmit;
+ extern int max_send;
int data_to_send = datasize;
int params_to_send = paramsize;
int useable_space;
/* The alignment_offset is to align the param and data bytes on an even byte
boundary. NT 4.0 Beta needs this to work correctly. */
useable_space = bufsize - ((smb_buf(outbuf)+alignment_offset) - outbuf);
- /* useable_space can never be more than maxxmit minus the
+ /* useable_space can never be more than max_send minus the
alignment offset. */
- useable_space = MIN(useable_space, maxxmit - alignment_offset);
+ useable_space = MIN(useable_space, max_send - alignment_offset);
while( params_to_send || data_to_send)
{