summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-09-17 19:48:19 +0000
committerJeremy Allison <jra@samba.org>2002-09-17 19:48:19 +0000
commit9bab1d0c1a51a7532da0c55a59cf5a91b8ab6a3d (patch)
treec6dbbe5495a7d3245be2a395383847afb654943d /source3/smbd
parentb33681fc0b8ef7b9fa91c154f7c3117afafa349e (diff)
downloadsamba-9bab1d0c1a51a7532da0c55a59cf5a91b8ab6a3d.tar.gz
samba-9bab1d0c1a51a7532da0c55a59cf5a91b8ab6a3d.tar.bz2
samba-9bab1d0c1a51a7532da0c55a59cf5a91b8ab6a3d.zip
Actually use sendfile if selected.
Jeremy. (This used to be commit 5881f0a22633ed9fb73e6cd788d0751c4db6cd32)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/reply.c2
-rw-r--r--source3/smbd/vfs-wrap.c7
-rw-r--r--source3/smbd/vfs.c3
3 files changed, 7 insertions, 5 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 45704b9264..b8a89b1d9d 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1723,7 +1723,7 @@ int send_file_readX(connection_struct *conn, char *inbuf,char *outbuf,int length
SSVAL(outbuf,smb_vwv5,smb_maxcnt);
SSVAL(outbuf,smb_vwv6,smb_offset(data,outbuf));
SSVAL(smb_buf(outbuf),-2,smb_maxcnt);
- CVAL(outbuf,smb_vwv0) = 0xFF;
+ SCVAL(outbuf,smb_vwv0,0xFF);
set_message(outbuf,12,smb_maxcnt,False);
header.data = outbuf;
header.length = data - outbuf;
diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c
index 27bb1f42f3..bae304096c 100644
--- a/source3/smbd/vfs-wrap.c
+++ b/source3/smbd/vfs-wrap.c
@@ -192,17 +192,16 @@ SMB_OFF_T vfswrap_lseek(files_struct *fsp, int filedes, SMB_OFF_T offset, int wh
return result;
}
-#if 0 /* JRATEST */
-ssize_t vfswrap_sendfile(int tofd, struct files_struct *fsp, int fromfd, DATA_BLOB *hdr, SMB_OFF_T offset, size_t n)
+ssize_t vfswrap_sendfile(int tofd, struct files_struct *fsp, int fromfd, const DATA_BLOB *hdr,
+ SMB_OFF_T offset, size_t n)
{
ssize_t result;
START_PROFILE_BYTES(syscall_sendfile, n);
- result = sys_sendfile(outfd, fsp, infd, hdr, offset, n);
+ result = sys_sendfile(tofd, fromfd, hdr, offset, n);
END_PROFILE(syscall_sendfile);
return result;
}
-#endif
int vfswrap_rename(connection_struct *conn, const char *old, const char *new)
{
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 6869c61861..a0a7b920b8 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -68,6 +68,7 @@ static struct vfs_ops default_vfs_ops = {
vfswrap_read,
vfswrap_write,
vfswrap_lseek,
+ vfswrap_sendfile,
vfswrap_rename,
vfswrap_fsync,
vfswrap_stat,
@@ -263,6 +264,7 @@ BOOL smbd_vfs_init(connection_struct *conn)
/*******************************************************************
Create vfs_ops reflecting current vfs_opaque_ops
*******************************************************************/
+
struct vfs_ops *smb_vfs_get_opaque_ops(void)
{
int i;
@@ -301,6 +303,7 @@ BOOL vfs_directory_exist(connection_struct *conn, const char *dname, SMB_STRUCT_
/*******************************************************************
vfs getwd wrapper
********************************************************************/
+
static char *vfs_getwd(connection_struct *conn, char *path)
{
return conn->vfs_ops.getwd(conn,path);