> On Aug. 25, 2015, 9:29 a.m., Benjamin Hindman wrote: > > 3rdparty/libprocess/src/io.cpp, lines 274-286 > > <https://reviews.apache.org/r/36404/diff/7/?file=1027739#file1027739line274> > > > > This is the "old style", in the "new style" we just dupliate the file > > descriptor so that if someone closes the file descriptor passed to us we > > don't either read from a closed file descriptor or WORSE read from a newly > > opened file descriptor that we shouldn't be reading from. See 'io::read(int > > fd)' for an example. Note that the other ones need to get changed as well > > but I've done that for the Mesos on Windows work (in the my > > github/benh/mesos mesos-on-windows branch, which was necessary to do there > > because we can't support os::isNonblock on Windows).
I initially had the dup() here (it's in this same review) but then Joris pointed out that ::recv() with MSG_PEEK set can not surpass single message boundaries. I removed the call to dup() because unlike the case with io::read() we are not looping here and are performing just a single peek() request. I will look into this further and will update accordingly. > On Aug. 25, 2015, 9:29 a.m., Benjamin Hindman wrote: > > 3rdparty/libprocess/src/io.cpp, line 577 > > <https://reviews.apache.org/r/36404/diff/7/?file=1027739#file1027739line577> > > > > The declaration uses the variable named 'limit' but here it's 'size' > > which sort of implies a different semantics? Either way, we should use the > > same name please. That was an oversight. Fixed. - Artem ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/36404/#review96342 ----------------------------------------------------------- On Aug. 5, 2015, 8:26 p.m., Artem Harutyunyan wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/36404/ > ----------------------------------------------------------- > > (Updated Aug. 5, 2015, 8:26 p.m.) > > > Review request for mesos, Joris Van Remoortere and Joseph Wu. > > > Bugs: MESOS-2964 > https://issues.apache.org/jira/browse/MESOS-2964 > > > Repository: mesos > > > Description > ------- > > JIRA: https://issues.apache.org/jira/browse/MESOS-2964 > > > Diffs > ----- > > 3rdparty/libprocess/include/process/io.hpp > 975923f40f82357f31b89428f24d01df6a8ac9fc > 3rdparty/libprocess/src/io.cpp 4a6e18a17012994d358099ad32d4c282fea3b0b1 > 3rdparty/libprocess/src/tests/io_tests.cpp > c642b3333ab9e2845668767ad237985cb9ce1109 > > Diff: https://reviews.apache.org/r/36404/diff/ > > > Testing > ------- > > - Added a test case for process::io::peek > - make check > > > Thanks, > > Artem Harutyunyan > >
