> On April 19, 2016, 10:31 p.m., Michael Park wrote:
> > 3rdparty/libprocess/src/poll_socket.cpp, lines 204-230
> > <https://reviews.apache.org/r/46285/diff/1/?file=1347495#file1347495line204>
> >
> >     How about we clean this up a little bit:
> >     
> >     ```cpp
> >     if (!length.isError()) {
> >       CHECK(length.get() >= 0);
> >       if (length.get() == 0) {
> >         // Socket closed.
> >         VLOG(1) << "Socket closed while sending";
> >       }
> >       return length.get();
> >     }
> >     
> >     if (net::is_restartable_error(length.error().code)) {
> >       // Interrupted, try again now.
> >       continue;
> >     } else if (net::is_retryable_error(length.error().code)) {
> >       // Might block, try again later.
> >       return io::poll(s, io::WRITE)
> >         .then(lambda::bind(&internal::socket_send_file, s, fd, offset, 
> > size));
> >     } else {
> >       // Socket error.
> >       VLOG(1) << length.error().message;
> >       return Failure(length.error());
> >     }
> >     ```

Are we sure this test & error is correct ? 
if (length.get() == 0) {
    // Socket closed.
    VLOG(1) << "Socket closed while sending";
}


- Daniel


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/46285/#review129635
-----------------------------------------------------------


On April 16, 2016, 12:20 a.m., Daniel Pravat wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46285/
> -----------------------------------------------------------
> 
> (Updated April 16, 2016, 12:20 a.m.)
> 
> 
> Review request for mesos, Artem Harutyunyan, Alex Clemmer, Joris Van 
> Remoortere, and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Windows: [2/3] `sendfile` used with the typed error state of `Try`.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/poll_socket.cpp 
> cb2878565a112017b190b4ff83dc65a876ea45f9 
> 
> Diff: https://reviews.apache.org/r/46285/diff/
> 
> 
> Testing
> -------
> 
> OSX: make check
> 
> 
> Thanks,
> 
> Daniel Pravat
> 
>

Reply via email to