Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
eeea1bbd
Commit
eeea1bbd
authored
Dec 17, 2009
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved some I/O comments.
parent
aa3999d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
+19
-17
io.c
io.c
+19
-17
No files found.
io.c
View file @
eeea1bbd
...
@@ -489,23 +489,25 @@ void restore_iobuf_size(xbuf *out)
...
@@ -489,23 +489,25 @@ void restore_iobuf_size(xbuf *out)
}
}
}
}
/* Perform buffered input and output until specified conditions are met. When
/* Perform buffered input and/or output until specified conditions are met.
* given a "needed" read requirement, we'll return without doing any I/O if the
* When given a "needed" read or write request, this returns without doing any
* iobuf.in bytes are already available. When reading, we'll read as many
* I/O if the needed input bytes or write space is already available. Once I/O
* bytes as we can into the buffer, and return as soon as we meet the minimum
* is needed, this will try to do whatever reading and/or writing is currently
* read requirement. When given a "needed" write requirement, we'll return
* possible, up to the maximum buffer allowances, no matter if this is a read
* without doing any I/O if that many bytes will fit in the output buffer (we
* or write request. However, the I/O stops as soon as the required input
* check either iobuf.out or iobuf.msg, depending on the flags). When writing,
* bytes or output space is available. If this is not a read request, the
* we write out as much as we can, and return as soon as the given free-space
* routine may also do some advantageous reading of messages from a multiplexed
* requirement is available.
* input source (which ensures that we don't jam up with everyone in their
* "need to write" code and nobody reading the accumulated data that would make
* writing possible).
*
*
* The iobuf.
out and iobuf.msg buffers are circular, so some writes into them
* The iobuf.
in, .out and .msg buffers are all circular. Callers need to be
*
will need to be split when the data needs to wrap around to the start. In
*
aware that some data copies will need to be split when the bytes wrap around
*
order to help make this easier for some operations (such as the use of
*
from the end to the start. In order to help make writing into the output
*
SIVAL() into the buffer) a buffer may be temporarily shortened, but
the
*
buffers easier for some operations (such as the use of SIVAL() into
the
*
original size will be automatically restored. The iobuf.in buffer is also
*
buffer) a buffer may be temporarily shortened by a small amount, but the
*
circular, so callers may need to split their reading of the data if it spans
*
original size will be automatically restored when the .pos wraps to the
*
the end
. See also the 3 raw_* iobuf vars that are used in the handling of
*
start
. See also the 3 raw_* iobuf vars that are used in the handling of
* MSG_DATA bytes as they are read-from/written-into the buffers.
* MSG_DATA bytes as they are read-from/written-into the buffers.
*
*
* When writing, we flush data in the following priority order:
* When writing, we flush data in the following priority order:
...
@@ -1370,7 +1372,7 @@ static void read_a_msg(void)
...
@@ -1370,7 +1372,7 @@ static void read_a_msg(void)
* the buffer the msg data will end once it is read. It is
* the buffer the msg data will end once it is read. It is
* possible that this points off the end of the buffer, in
* possible that this points off the end of the buffer, in
* which case the gradual reading of the input stream will
* which case the gradual reading of the input stream will
* cause this value to
decrease
and eventually become real. */
* cause this value to
wrap around
and eventually become real. */
if
(
msg_bytes
)
if
(
msg_bytes
)
iobuf
.
raw_input_ends_before
=
iobuf
.
in
.
pos
+
msg_bytes
;
iobuf
.
raw_input_ends_before
=
iobuf
.
in
.
pos
+
msg_bytes
;
iobuf
.
in_multiplexed
=
1
;
iobuf
.
in_multiplexed
=
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment