summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h3
-rw-r--r--source3/param/loadparm.c5
-rw-r--r--source3/smbd/reply.c6
3 files changed, 9 insertions, 5 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 0efd8f0e35..b28e5f51e4 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4389,7 +4389,8 @@ const char *lp_printcapname(void);
bool lp_disable_spoolss( void );
void lp_set_spoolss_state( uint32 state );
uint32 lp_get_spoolss_state( void );
-bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state);
+bool lp_use_sendfile(int snum, enum protocol_types proto,
+ struct smb_signing_state *signing_state);
void set_use_sendfile(int snum, bool val);
void set_store_dos_attributes(int snum, bool val);
void lp_set_mangling_method(const char *new_method);
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 78a5aa809f..17a4e2dce3 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -9713,12 +9713,13 @@ uint32 lp_get_spoolss_state( void )
Ensure we don't use sendfile if server smb signing is active.
********************************************************************/
-bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state)
+bool lp_use_sendfile(int snum, enum protocol_types proto,
+ struct smb_signing_state *signing_state)
{
bool sign_active = false;
/* Using sendfile blows the brains out of any DOS or Win9x TCP stack... JRA. */
- if (get_Protocol() < PROTOCOL_NT1) {
+ if (proto < PROTOCOL_NT1) {
return false;
}
if (signing_state) {
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 4d7166fe9f..0b77d82edd 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2925,7 +2925,8 @@ static void send_file_readbraw(connection_struct *conn,
if ( !req_is_in_chain(req) && (nread > 0) && (fsp->base_fsp == NULL) &&
(fsp->wcp == NULL) &&
- lp_use_sendfile(SNUM(conn), smbd_server_conn->smb1.signing_state) ) {
+ lp_use_sendfile(SNUM(conn), get_Protocol(),
+ smbd_server_conn->smb1.signing_state) ) {
ssize_t sendfile_read = -1;
char header[4];
DATA_BLOB header_blob;
@@ -3452,7 +3453,8 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req,
if (!req_is_in_chain(req) &&
!is_encrypted_packet(req->inbuf) && (fsp->base_fsp == NULL) &&
(fsp->wcp == NULL) &&
- lp_use_sendfile(SNUM(conn), smbd_server_conn->smb1.signing_state) ) {
+ lp_use_sendfile(SNUM(conn), get_Protocol(),
+ smbd_server_conn->smb1.signing_state) ) {
uint8 headerbuf[smb_size + 12 * 2];
DATA_BLOB header;