The Samba-Bugzilla – Attachment 3812 Details for
Bug 5969
smbclient x_fread optimization
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
optimize smbclient write performance
smbclient_x_fread.patch (text/plain), 724 bytes, created by
Andrew Gaul
on 2008-12-14 14:13:43 UTC
(
hide
)
Description:
optimize smbclient write performance
Filename:
MIME Type:
Creator:
Andrew Gaul
Created:
2008-12-14 14:13:43 UTC
Size:
724 bytes
patch
obsolete
>--- samba-3.2.6-orig/source/lib/xfile.c 2008-12-10 03:12:23.000000000 -0800 >+++ samba-3.2.6/source/lib/xfile.c 2008-12-13 13:07:38.000000000 -0800 >@@ -356,10 +356,21 @@ size_t x_fread(void *p, size_t size, siz > { > size_t total = 0; > while (total < size*nmemb) { >- int c = x_fgetc(f); >- if (c == EOF) break; >- (total+(char *)p)[0] = (char)c; >- total++; >+ if (f->flags & (X_FLAG_EOF | X_FLAG_ERROR)) break; >+ >+ if (f->bufused == 0) x_fillbuf(f); >+ >+ if (f->bufused == 0) { >+ f->flags |= X_FLAG_EOF; >+ break; >+ } >+ >+ size_t nbytes = MIN(size*nmemb - total, f->bufused); >+ memcpy(p, f->next, nbytes); >+ f->next += nbytes; >+ f->bufused -= nbytes; >+ total += nbytes; >+ p += nbytes; > } > return total/size; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 5969
: 3812