diff --git a/rsfbclient-native/src/params.rs b/rsfbclient-native/src/params.rs index b606f2d..81d9f12 100644 --- a/rsfbclient-native/src/params.rs +++ b/rsfbclient-native/src/params.rs @@ -244,15 +244,18 @@ fn binary_to_blob( // Assert that the handle is valid debug_assert_ne!(handle, 0); - unsafe { - if ibase.isc_put_segment()( - &mut status[0], - &mut handle, - bytes.len() as u16, - bytes.as_ptr() as *mut std::os::raw::c_char, - ) != 0 - { - return Err(status.as_error(ibase)); + // Max segment size: 65535 + for b in bytes.chunks(65535) { + unsafe { + if ibase.isc_put_segment()( + &mut status[0], + &mut handle, + b.len() as u16, + b.as_ptr() as *mut std::os::raw::c_char, + ) != 0 + { + return Err(status.as_error(ibase)); + } } } diff --git a/src/tests/params.rs b/src/tests/params.rs index 4fd853a..50449aa 100644 --- a/src/tests/params.rs +++ b/src/tests/params.rs @@ -244,7 +244,7 @@ mk_tests_default! { let rstr: Vec = rand::thread_rng() .sample_iter::(Standard) - .take(10000) + .take(1024 * 1024) .collect(); conn.execute("DROP TABLE PBIGBLOBBIN", ()).ok(); @@ -261,7 +261,7 @@ mk_tests_default! { let rstr: String = rand::thread_rng() .sample_iter::(Standard) - .take(10000) + .take(1024 * 1024) .collect(); conn.execute("DROP TABLE PBIGBLOBTEXT", ()).ok(); diff --git a/src/tests/row.rs b/src/tests/row.rs index a8ed52b..dcde821 100644 --- a/src/tests/row.rs +++ b/src/tests/row.rs @@ -166,7 +166,7 @@ mk_tests_default! { let rvec: Vec = rand::thread_rng() .sample_iter(Standard) - .take(10000) + .take(1024 * 1024) .collect(); conn.execute("DROP TABLE RBIGBLOBBIN", ()).ok(); @@ -187,7 +187,7 @@ mk_tests_default! { let rstr: String = rand::thread_rng() .sample_iter::(Standard) - .take(10000) + .take(1024 * 1024) .collect(); conn.execute("DROP TABLE RBIGBLOBTEXT", ()).ok();