The branch, master has been updated
       via  728cfa5 s3: libsmbclient: Use cache targetcli in SMBC_splice_ctx 
calls also.
      from  0615b72 smbd/trans2: add a useful diagnostic for files with bad 
encoding

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 728cfa5d3983c545f2a09947c8aabc90da3b5bc5
Author: Jeremy Allison <[email protected]>
Date:   Mon Jun 8 10:07:49 2015 -0700

    s3: libsmbclient: Use cache targetcli in SMBC_splice_ctx calls also.
    
    Bug 11295 - Excessive cli_resolve_path() usage can slow down transmission.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11295
    
    Signed-off-by: Jeremy Allison <[email protected]>
    Reviewed-by: David Disseldorp <[email protected]>
    
    Autobuild-User(master): David Disseldorp <[email protected]>
    Autobuild-Date(master): Wed Jun 10 04:09:36 CEST 2015 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 source3/libsmb/libsmb_file.c | 62 ++------------------------------------------
 1 file changed, 2 insertions(+), 60 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c
index 29a6a0f..6b43676 100644
--- a/source3/libsmb/libsmb_file.c
+++ b/source3/libsmb/libsmb_file.c
@@ -299,12 +299,6 @@ SMBC_splice_ctx(SMBCCTX *context,
                 void *priv)
 {
        off_t written;
-       char *server = NULL, *share = NULL, *user = NULL, *password = NULL;
-       char *path = NULL;
-       char *targetpath = NULL;
-       struct cli_state *srccli = NULL;
-       struct cli_state *dstcli = NULL;
-       uint16_t port = 0;
        TALLOC_CTX *frame = talloc_stackframe();
        NTSTATUS status;
 
@@ -330,64 +324,12 @@ SMBC_splice_ctx(SMBCCTX *context,
                return -1;
        }
 
-       if (SMBC_parse_path(frame,
-                            context,
-                            srcfile->fname,
-                            NULL,
-                            &server,
-                            &port,
-                            &share,
-                            &path,
-                            &user,
-                            &password,
-                            NULL)) {
-                errno = EINVAL;
-               TALLOC_FREE(frame);
-                return -1;
-        }
-
-       status = cli_resolve_path(frame, "", context->internal->auth_info,
-                                 srcfile->srv->cli, path,
-                                 &srccli, &targetpath);
-       if (!NT_STATUS_IS_OK(status)) {
-               d_printf("Could not resolve %s\n", path);
-                errno = ENOENT;
-               TALLOC_FREE(frame);
-               return -1;
-       }
-
-       if (SMBC_parse_path(frame,
-                            context,
-                            dstfile->fname,
-                            NULL,
-                            &server,
-                            &port,
-                            &share,
-                            &path,
-                            &user,
-                            &password,
-                            NULL)) {
-                errno = EINVAL;
-               TALLOC_FREE(frame);
-                return -1;
-        }
-
-       status = cli_resolve_path(frame, "", context->internal->auth_info,
-                                 dstfile->srv->cli, path,
-                                 &dstcli, &targetpath);
-       if (!NT_STATUS_IS_OK(status)) {
-               d_printf("Could not resolve %s\n", path);
-                errno = ENOENT;
-               TALLOC_FREE(frame);
-               return -1;
-       }
-
-       status = cli_splice(srccli, dstcli,
+       status = cli_splice(srcfile->targetcli, dstfile->targetcli,
                            srcfile->cli_fd, dstfile->cli_fd,
                            count, srcfile->offset, dstfile->offset, &written,
                            splice_cb, priv);
        if (!NT_STATUS_IS_OK(status)) {
-               errno = SMBC_errno(context, srccli);
+               errno = SMBC_errno(context, srcfile->targetcli);
                TALLOC_FREE(frame);
                return -1;
        }


-- 
Samba Shared Repository

Reply via email to