aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-08-24 21:32:42 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-08-24 21:32:42 +0300
commit440da6959f36022185fc465590b53bd10acda862 (patch)
treeb693330c9fe94b312f1068a7e69bcaf59b7c6edb
parent0fb5e5e068326b23493952619d7efb640cb37377 (diff)
Add note that stream callbacks must read the whole requested length.
Fixes issue #22.
-rw-r--r--docs/concepts.rst1
1 files changed, 1 insertions, 0 deletions
diff --git a/docs/concepts.rst b/docs/concepts.rst
index 122d29cf..d3261146 100644
--- a/docs/concepts.rst
+++ b/docs/concepts.rst
@@ -50,6 +50,7 @@ There are a few generic rules for callback functions:
#) Use state to store your own data, such as a file descriptor.
#) *bytes_written* and *bytes_left* are updated by pb_write and pb_read.
#) Your callback may be used with substreams. In this case *bytes_left*, *bytes_written* and *max_size* have smaller values than the original stream. Don't use these values to calculate pointers.
+#) Always read or write the full requested length of data. For example, POSIX *recv()* needs the *MSG_WAITALL* parameter to accomplish this.
Output streams
--------------