summaryrefslogtreecommitdiffstats
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-06-12 08:40:25 +0200
committerMichael Adam <obnox@samba.org>2014-08-06 09:51:14 +0200
commitc18a62ee9d0a7c77e375b5dff3e144e53557ceaa (patch)
treedd6f6d55951d81e9dd4e0f2128e8aca52c4e0986 /source3/smbd/reply.c
parentbd19fd1286821433fc9080e91316b831ef501a1d (diff)
downloadsamba-c18a62ee9d0a7c77e375b5dff3e144e53557ceaa.tar.gz
samba-c18a62ee9d0a7c77e375b5dff3e144e53557ceaa.tar.xz
samba-c18a62ee9d0a7c77e375b5dff3e144e53557ceaa.zip
s3:smbd: pass smbXsrv_connection explicitly to fake_sendfile()
In future (with multi-channel) a fsp can be used from multiple connections, we need to make it explicit on which we want to reply. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index f348666860..83df104478 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -3026,9 +3026,9 @@ static void fail_readraw(void)
Fake (read/write) sendfile. Returns -1 on read or write fail.
****************************************************************************/
-ssize_t fake_sendfile(files_struct *fsp, off_t startpos, size_t nread)
+ssize_t fake_sendfile(struct smbXsrv_connection *xconn, files_struct *fsp,
+ off_t startpos, size_t nread)
{
- struct smbXsrv_connection *xconn = fsp->conn->sconn->conn;
size_t bufsize;
size_t tosend = nread;
char *buf;
@@ -3239,7 +3239,7 @@ static void send_file_readbraw(connection_struct *conn,
set_use_sendfile(SNUM(conn), False);
DEBUG(0,("send_file_readbraw: sendfile not available. Faking..\n"));
- if (fake_sendfile(fsp, startpos, nread) == -1) {
+ if (fake_sendfile(xconn, fsp, startpos, nread) == -1) {
DEBUG(0,("send_file_readbraw: "
"fake_sendfile failed for "
"file %s (%s).\n",
@@ -3774,7 +3774,7 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req,
/* Ensure we don't do this again. */
set_use_sendfile(SNUM(conn), False);
DEBUG(0,("send_file_readX: sendfile not available. Faking..\n"));
- nread = fake_sendfile(fsp, startpos,
+ nread = fake_sendfile(xconn, fsp, startpos,
smb_maxcnt);
if (nread == -1) {
saved_errno = errno;
@@ -3851,7 +3851,7 @@ normal_read:
errno = saved_errno;
exit_server_cleanly("send_file_readX sendfile failed");
}
- nread = fake_sendfile(fsp, startpos, smb_maxcnt);
+ nread = fake_sendfile(xconn, fsp, startpos, smb_maxcnt);
if (nread == -1) {
saved_errno = errno;
DEBUG(0,("send_file_readX: fake_sendfile failed for file "