mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anand Mazumdar" <mazumdar.an...@gmail.com>
Subject Re: Review Request 38416: Allow HTTP response codes to be checked with code.
Date Wed, 23 Sep 2015 16:58:53 GMT

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


LGTM , just some comments (see inline) around the `struct Status` being an `enum` directly
and `int code` being an `Status code` too. We can do a `static_cast` in the decoder for converting
the `int` status code to `enum` i.e. `decoder->response->code = static_cast<Status>(decoder->parser.status_code);`
What do you think ?


3rdparty/libprocess/include/process/http.hpp (line 94)
<https://reviews.apache.org/r/38416/#comment157369>

    Why not `enum class Status` directly from C++11 ?



3rdparty/libprocess/include/process/http.hpp (line 391)
<https://reviews.apache.org/r/38416/#comment157370>

    Read my earlier comment about `struct Status` being `enum class Status` and this can be
changed to `Status code` ?
    
    I hate `enum to int` conversions anyways :(



3rdparty/libprocess/src/http.cpp (line 77)
<https://reviews.apache.org/r/38416/#comment157368>

    Why not implement a `stringify(...)` for the newly created enum and make the `statuses[]`
use it ? This would allow us to now keep two things at sync at once unless I am missing something
?


- Anand Mazumdar


On Sept. 23, 2015, 7:59 a.m., Timothy Chen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38416/
> -----------------------------------------------------------
> 
> (Updated Sept. 23, 2015, 7:59 a.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, Jie Yu, Jojy Varghese, and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-3429
>     https://issues.apache.org/jira/browse/MESOS-3429
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Allow HTTP response codes to be checked with code.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/http.hpp fbd6cf7967173495875a8ea90ed28ade88b982a2

>   3rdparty/libprocess/src/decoder.hpp 67a5135f302153e376e8dfe8db82aa0b15449389 
>   3rdparty/libprocess/src/http.cpp 9ad613a16c379b6d76a9a0f8d6160fe23a182fd4 
> 
> Diff: https://reviews.apache.org/r/38416/diff/
> 
> 
> Testing
> -------
> 
> make
> 
> 
> Thanks,
> 
> Timothy Chen
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message