failed to send a long data ( > 512bytes ) #60
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Hello team,
I failed to send a long data(> 512bytes), using BearSSLClient::write(const uint8_t *buf, size_t size)
Suppose that buf stored 600 bytes data and
br_sslio_write()
could send 512 bytes at maximum each call.Call
write(buf, 600)
Expected behavior
write()
sends 600 bytes and returns 600Current behavior
write()
sends 1024 bytes and returns 1024Detail:
write(buf, 600)
while
loopbr_sslio_write()
sends 512 bytes from&buf[0]
and returns 512, buf points at &buf[512], written = 512written < size
is truewhile
loopbr_sslio_write()
sends 512 bytes from&buf[512]
and returns 512, buf points at &buf[1024], written = 1024written < size
is false and escaping from the loopwrite()
returns 1024To fix this issue, I'd like to change here
from:
int result = br_sslio_write(&_ioc, buf, size);
to:
int result = br_sslio_write(&_ioc, buf, size - written);
The text was updated successfully, but these errors were encountered: