The Samba-Bugzilla – Attachment 1872 Details for
Bug 3668
smbclient fails to read last chunk of file, when CAP_LARGE_READX is set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
look (text/plain), 2.97 KB, created by
Jeremy Allison
on 2006-04-21 21:31:43 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2006-04-21 21:31:43 UTC
Size:
2.97 KB
patch
obsolete
>Index: libsmb/clireadwrite.c >=================================================================== >--- libsmb/clireadwrite.c (revision 15160) >+++ libsmb/clireadwrite.c (working copy) >@@ -76,7 +76,11 @@ > */ > > if (cli->capabilities & CAP_LARGE_READX) { >- readsize = CLI_MAX_LARGE_READX_SIZE; >+ if (cli->is_samba) { >+ readsize = CLI_SAMBA_MAX_LARGE_READX_SIZE; >+ } else { >+ readsize = CLI_WINDOWS_MAX_LARGE_READX_SIZE; >+ } > } else { > readsize = (cli->max_xmit - (smb_size+32)) & ~1023; > } >Index: libsmb/cliconnect.c >=================================================================== >--- libsmb/cliconnect.c (revision 15160) >+++ libsmb/cliconnect.c (working copy) >@@ -199,6 +199,10 @@ > p += clistr_pull(cli, cli->server_type, p, sizeof(fstring), -1, STR_TERMINATE); > p += clistr_pull(cli, cli->server_domain, p, sizeof(fstring), -1, STR_TERMINATE); > >+ if (strstr(cli->server_type, "Samba")) { >+ cli->is_samba = True; >+ } >+ > fstrcpy(cli->user_name, ""); > > return True; >@@ -263,6 +267,10 @@ > p += clistr_pull(cli, cli->server_domain, p, sizeof(fstring), -1, STR_TERMINATE); > fstrcpy(cli->user_name, user); > >+ if (strstr(cli->server_type, "Samba")) { >+ cli->is_samba = True; >+ } >+ > return True; > } > >@@ -408,6 +416,10 @@ > p += clistr_pull(cli, cli->server_type, p, sizeof(fstring), -1, STR_TERMINATE); > p += clistr_pull(cli, cli->server_domain, p, sizeof(fstring), -1, STR_TERMINATE); > >+ if (strstr(cli->server_type, "Samba")) { >+ cli->is_samba = True; >+ } >+ > fstrcpy(cli->user_name, user); > > if (session_key.data) { >@@ -873,6 +885,10 @@ > } > } > >+ if (strstr(cli->server_type, "Samba")) { >+ cli->is_samba = True; >+ } >+ > return True; > > } >@@ -1159,9 +1175,9 @@ > if (cli->capabilities & (CAP_LARGE_READX|CAP_LARGE_WRITEX)) { > SAFE_FREE(cli->outbuf); > SAFE_FREE(cli->inbuf); >- cli->outbuf = (char *)SMB_MALLOC(CLI_MAX_LARGE_READX_SIZE+SAFETY_MARGIN); >- cli->inbuf = (char *)SMB_MALLOC(CLI_MAX_LARGE_READX_SIZE+SAFETY_MARGIN); >- cli->bufsize = CLI_MAX_LARGE_READX_SIZE; >+ cli->outbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+SAFETY_MARGIN); >+ cli->inbuf = (char *)SMB_MALLOC(CLI_SAMBA_MAX_LARGE_READX_SIZE+SAFETY_MARGIN); >+ cli->bufsize = CLI_SAMBA_MAX_LARGE_READX_SIZE; > } > > } else if (cli->protocol >= PROTOCOL_LANMAN1) { >Index: include/client.h >=================================================================== >--- include/client.h (revision 15160) >+++ include/client.h (working copy) >@@ -27,7 +27,8 @@ > overlap on the wire. This size gives us a nice read/write size, which > will be a multiple of the page size on almost any system */ > #define CLI_BUFFER_SIZE (0xFFFF) >-#define CLI_MAX_LARGE_READX_SIZE (127*1024) >+#define CLI_SAMBA_MAX_LARGE_READX_SIZE (127*1024) /* Works for Samba servers */ >+#define CLI_WINDOWS_MAX_LARGE_READX_SIZE ((64*1024)-2) /* Windows servers are broken.... */ > > /* > * These definitions depend on smb.h >@@ -143,6 +144,7 @@ > unsigned int bufsize; > int initialised; > int win95; >+ BOOL is_samba; > uint32 capabilities; > BOOL dfsroot; >
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 3668
: 1872