--- ADFS::Rik2.$.riscos.src-iyo-dev/5/27/tar.TungstenDev.apache.RiscOS.Sources.Networking.Omni.Protocols.LanManFS.c.SMB 2018-11-16 12:03:49.0 +0000 +++ ADFS::Rik2.$.riscos.apache.RiscOS.Sources.Networking.Omni.Protocols.LanManFS.c.SMB 2018-11-16 12:03:49.0 +0000 @@ -111,6 +111,12 @@ #define WRRAW_BLOCK_SIZE 16384 #define PRN_BLOCK_SIZE 1024 +/* + * SMB packet size as defined in smbd/reply.c +*/ +#define SMB_SIZE 39 +#define MAX_RX_DATA_SIZE (MAX_RX_BLOCK_SIZE - (SMB_SIZE + 5*2 + 3)) + /* This structure relies on Norcroft C packing the bytes & words properly! */ @@ -2619,7 +2625,7 @@ err_t SMB_Read ( int FH, uint offset, ui while ( len_left > 0 ) { SMB_TxWords[0] = fid; - SMB_TxWords[1] = min(len_left, MAX_RX_BLOCK_SIZE); + SMB_TxWords[1] = min(len_left, MAX_RX_DATA_SIZE); // was MAX_RX_BLOCK_SIZE SMB_TxWords[2] = offset & 0xFFFF; SMB_TxWords[3] = (offset >> 16 ); SMB_TxWords[4] = (len_left); @@ -2648,7 +2654,7 @@ err_t SMB_Read ( int FH, uint offset, ui FreeChain(pB_res); - if ( n_read < MAX_RX_BLOCK_SIZE ) /* Reached end of file */ + if ( n_read < MAX_RX_DATA_SIZE ) /* Reached end of file */ // was MAX_RX_BLOCK_SIZE break; }