Go to file
Paul Sokolovsky 25307d5331 net: net_pkt_append: Refactor to return length of data actually added
For stream-based protocols (TCP), adding less data than requested
("short write") is generally not a problem - the rest of data can
be sent in the next packet. So, make net_pkt_append() return length
of written data instead of just bool flag, which makes it closer
to the behavior of POSIX send()/write() calls.

There're many users of older net_pkt_append() in the codebase
however, so net_pkt_append_all() convenience function is added which
keeps returning a boolean flag. All current users were converted to
this function, except for two:

samples/net/http_server/src/ssl_utils.c
samples/net/mbedtls_sslclient/src/tcp.c

Both are related to TLS and implement mbedTLS "tx callback", which
follows POSIX short-write semantics. Both cases also had a code to
workaround previous boolean-only behavior of net_pkt_append() - after
calling it, they measured length of the actual data added (but only
in case of successful return of net_pkt_append(), so that didn't
really help). So, these 2 cases are already improved.

Jira: ZEP-1984

Change-Id: Ibaf7c029b15e91b516d73dab3612eed190ee982b
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-28 15:01:09 +03:00
.known-issues
arch
boards boards: sam_e70_xplained: read MAC from I2C EEPROM by default 2017-04-28 15:01:09 +03:00
doc
drivers net: net_pkt_append: Refactor to return length of data actually added 2017-04-28 15:01:09 +03:00
dts
ext
include net: net_pkt_append: Refactor to return length of data actually added 2017-04-28 15:01:09 +03:00
kernel
lib
misc
samples net: net_pkt_append: Refactor to return length of data actually added 2017-04-28 15:01:09 +03:00
scripts ci: add CI/CD integration and related scripts 2017-04-27 20:58:14 -04:00
subsys net: net_pkt_append: Refactor to return length of data actually added 2017-04-28 15:01:09 +03:00
tests net: net_pkt_append: Refactor to return length of data actually added 2017-04-28 15:01:09 +03:00
.checkpatch.conf
.gitattributes
.gitignore
.gitlint
.gitreview
.mailmap
.shippable.yml ci: add CI/CD integration and related scripts 2017-04-27 20:58:14 -04:00
defaults.tc
Kbuild
Kconfig
Kconfig.zephyr
LICENSE
MAINTAINERS
Makefile
Makefile.inc
Makefile.test
zephyr-env.sh