You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Bernd Mathiske <be...@mesosphere.io> on 2015/02/04 07:03:39 UTC

Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

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

Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.


Bugs: MESOS-2072
    https://issues.apache.org/jira/browse/MESOS-2072


Repository: mesos


Description
-------

Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.

This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.


Diffs
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp a0210ea 

Diff: https://reviews.apache.org/r/30606/diff/


Testing
-------

Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.


Thanks,

Bernd Mathiske


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Bernd Mathiske <be...@mesosphere.io>.

> On Feb. 18, 2015, 11:27 p.m., Nikita Vetoshkin wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp, line 89
> > <https://reviews.apache.org/r/30606/diff/2/?file=867390#file867390line89>
> >
> >     Can we clarify that we'll issue HEAD request?

OK. I added this to the comment on top of the function.


> On Feb. 18, 2015, 11:27 p.m., Nikita Vetoshkin wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp, line 113
> > <https://reviews.apache.org/r/30606/diff/2/?file=867390#file867390line113>
> >
> >     There is an issue with deflated responses. Content-Length can differ like a lot from uncompressed body. Do we somehow handle this case?
> >     If not - can we leave a comment about that?
> >     
> >     JFYI, there's Cteonnt-Length header, which containes uncompressed content size (not sure how widely it is used).

This function merely retrieves the contents of the content-length field. We do not need to take a position wrt. what values of this field may or may not mean here.


- Bernd


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


On Feb. 18, 2015, 12:01 a.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 18, 2015, 12:01 a.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b464e517bb1e7b6b381c6cd6c0466ed788a82615 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Nikita Vetoshkin <ni...@gmail.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30606/#review73096
-----------------------------------------------------------



3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp
<https://reviews.apache.org/r/30606/#comment119298>

    Can we clarify that we'll issue HEAD request?



3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp
<https://reviews.apache.org/r/30606/#comment119299>

    There is an issue with deflated responses. Content-Length can differ like a lot from uncompressed body. Do we somehow handle this case?
    If not - can we leave a comment about that?
    
    JFYI, there's Cteonnt-Length header, which containes uncompressed content size (not sure how widely it is used).


- Nikita Vetoshkin


On Feb. 18, 2015, 8:01 a.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 18, 2015, 8:01 a.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b464e517bb1e7b6b381c6cd6c0466ed788a82615 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Bernd Mathiske <be...@mesosphere.io>.

> On Feb. 23, 2015, 3:52 p.m., Timothy Chen wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp, line 93
> > <https://reviews.apache.org/r/30606/diff/3/?file=869525#file869525line93>
> >
> >     Should we move this to a static initializtion that just gets called once? According to the docs, it states that the global_init is not thread safe either.
> 
> Bernd Mathiske wrote:
>     "man curl_global_init" says:
>     
>            This function must be called at least once within a program  (...)
>            before the program calls any other function in libcurl. ...,
>            so multiple calls have the same effect as one call.
> 
> Timothy Chen wrote:
>     My point is that it's not thread safe, and this method is exposed as helper function that can be called anywhere.

A few lines further down is "download", which I copied my code from. How did this ever work correctly?


- Bernd


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


On Feb. 19, 2015, 7:51 a.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 19, 2015, 7:51 a.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b464e517bb1e7b6b381c6cd6c0466ed788a82615 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Bernd Mathiske <be...@mesosphere.io>.

> On Feb. 23, 2015, 3:52 p.m., Timothy Chen wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp, line 93
> > <https://reviews.apache.org/r/30606/diff/3/?file=869525#file869525line93>
> >
> >     Should we move this to a static initializtion that just gets called once? According to the docs, it states that the global_init is not thread safe either.

"man curl_global_init" says:

       This function must be called at least once within a program  (...)
       before the program calls any other function in libcurl. ...,
       so multiple calls have the same effect as one call.


- Bernd


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


On Feb. 19, 2015, 7:51 a.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 19, 2015, 7:51 a.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b464e517bb1e7b6b381c6cd6c0466ed788a82615 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Timothy Chen <tn...@apache.org>.

> On Feb. 23, 2015, 11:52 p.m., Timothy Chen wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp, line 93
> > <https://reviews.apache.org/r/30606/diff/3/?file=869525#file869525line93>
> >
> >     Should we move this to a static initializtion that just gets called once? According to the docs, it states that the global_init is not thread safe either.
> 
> Bernd Mathiske wrote:
>     "man curl_global_init" says:
>     
>            This function must be called at least once within a program  (...)
>            before the program calls any other function in libcurl. ...,
>            so multiple calls have the same effect as one call.

My point is that it's not thread safe, and this method is exposed as helper function that can be called anywhere.


- Timothy


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


On Feb. 19, 2015, 3:51 p.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 19, 2015, 3:51 p.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b464e517bb1e7b6b381c6cd6c0466ed788a82615 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Bernd Mathiske <be...@mesosphere.io>.

> On Feb. 23, 2015, 3:52 p.m., Timothy Chen wrote:
> > 3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp, line 93
> > <https://reviews.apache.org/r/30606/diff/3/?file=869525#file869525line93>
> >
> >     Should we move this to a static initializtion that just gets called once? According to the docs, it states that the global_init is not thread safe either.
> 
> Bernd Mathiske wrote:
>     "man curl_global_init" says:
>     
>            This function must be called at least once within a program  (...)
>            before the program calls any other function in libcurl. ...,
>            so multiple calls have the same effect as one call.
> 
> Timothy Chen wrote:
>     My point is that it's not thread safe, and this method is exposed as helper function that can be called anywhere.
> 
> Bernd Mathiske wrote:
>     A few lines further down is "download", which I copied my code from. How did this ever work correctly?

I supposse it did not. OK, I can fix this. Hold on...


- Bernd


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


On Feb. 19, 2015, 7:51 a.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 19, 2015, 7:51 a.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b464e517bb1e7b6b381c6cd6c0466ed788a82615 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Timothy Chen <tn...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30606/#review73709
-----------------------------------------------------------



3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp
<https://reviews.apache.org/r/30606/#comment120094>

    Should we move this to a static initializtion that just gets called once? According to the docs, it states that the global_init is not thread safe either.


- Timothy Chen


On Feb. 19, 2015, 3:51 p.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 19, 2015, 3:51 p.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b464e517bb1e7b6b381c6cd6c0466ed788a82615 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Till Toenshoff <to...@me.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30606/#review74445
-----------------------------------------------------------

Ship it!



3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp
<https://reviews.apache.org/r/30606/#comment121015>

    Just like Nikita, I think it really makes sense to add a comment here, hinting that the returned value may actually be entirely bogus. 
    
    See http://curl.haxx.se/mail/lib-2003-06/0146.html


- Till Toenshoff


On Feb. 27, 2015, 2:33 a.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 27, 2015, 2:33 a.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 9635bbc6f7dae1d75a780069fcc60fb706221053 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Benjamin Hindman <be...@berkeley.edu>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30606/#review84855
-----------------------------------------------------------

Ship it!


Ship It!

- Benjamin Hindman


On Feb. 28, 2015, 2:51 p.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 28, 2015, 2:51 p.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 9635bbc6f7dae1d75a780069fcc60fb706221053 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Bernd Mathiske <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30606/
-----------------------------------------------------------

(Updated Feb. 28, 2015, 6:51 a.m.)


Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.


Changes
-------

Added comment that content-length may not contain any useful value.


Bugs: MESOS-2072
    https://issues.apache.org/jira/browse/MESOS-2072


Repository: mesos


Description
-------

Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.

This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 9635bbc6f7dae1d75a780069fcc60fb706221053 

Diff: https://reviews.apache.org/r/30606/diff/


Testing
-------

Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.


Thanks,

Bernd Mathiske


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Bernd Mathiske <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30606/
-----------------------------------------------------------

(Updated Feb. 26, 2015, 6:33 p.m.)


Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.


Changes
-------

Thread-safe libcurl initialization.


Bugs: MESOS-2072
    https://issues.apache.org/jira/browse/MESOS-2072


Repository: mesos


Description
-------

Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.

This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp 9635bbc6f7dae1d75a780069fcc60fb706221053 

Diff: https://reviews.apache.org/r/30606/diff/


Testing
-------

Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.


Thanks,

Bernd Mathiske


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Bernd Mathiske <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30606/
-----------------------------------------------------------

(Updated Feb. 19, 2015, 7:51 a.m.)


Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.


Changes
-------

Augmented function comment.


Bugs: MESOS-2072
    https://issues.apache.org/jira/browse/MESOS-2072


Repository: mesos


Description
-------

Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.

This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b464e517bb1e7b6b381c6cd6c0466ed788a82615 

Diff: https://reviews.apache.org/r/30606/diff/


Testing
-------

Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.


Thanks,

Bernd Mathiske


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Bernd Mathiske <be...@mesosphere.io>.

> On Feb. 18, 2015, 12:22 a.m., Timothy Chen wrote:
> > Do we have test for this?

No. If you look at tests/net.cpp you will find that we don't have any tests whatsoever for anything in net:: that involve any network traffic. I suppose this is so because it is so much easier to write these against these functions once you have libprocess! Furthermore they get excercised by Mesos tests. This particular function is tested daily by fetcher cache tests which are under review.


- Bernd


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


On Feb. 18, 2015, 12:01 a.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 18, 2015, 12:01 a.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b464e517bb1e7b6b381c6cd6c0466ed788a82615 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Timothy Chen <tn...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30606/#review72923
-----------------------------------------------------------


Do we have test for this?

- Timothy Chen


On Feb. 18, 2015, 8:01 a.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 18, 2015, 8:01 a.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b464e517bb1e7b6b381c6cd6c0466ed788a82615 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Bernd Mathiske <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30606/
-----------------------------------------------------------

(Updated Feb. 18, 2015, 12:01 a.m.)


Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.


Changes
-------

Changed return type to Bytes. Rebased.


Bugs: MESOS-2072
    https://issues.apache.org/jira/browse/MESOS-2072


Repository: mesos


Description
-------

Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.

This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.


Diffs (updated)
-----

  3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp b464e517bb1e7b6b381c6cd6c0466ed788a82615 

Diff: https://reviews.apache.org/r/30606/diff/


Testing
-------

Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.


Thanks,

Bernd Mathiske


Re: Review Request 30606: Added net::contentLength() to query "content-length" field from HTTP header.

Posted by Mesos ReviewBot <de...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/30606/#review70931
-----------------------------------------------------------


Patch looks great!

Reviews applied: [30606]

All tests passed.

- Mesos ReviewBot


On Feb. 4, 2015, 6:03 a.m., Bernd Mathiske wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30606/
> -----------------------------------------------------------
> 
> (Updated Feb. 4, 2015, 6:03 a.m.)
> 
> 
> Review request for mesos, Adam B, Benjamin Hindman, Till Toenshoff, and Timothy Chen.
> 
> 
> Bugs: MESOS-2072
>     https://issues.apache.org/jira/browse/MESOS-2072
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds net::contentLength(). This makes a short HTTP request to read the "content-length" field from the HTTP header.
> 
> This will be used to determine the size of a file before downloading it to the fetcher cache, in order to ensure there is enough space ahead of time.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/net.hpp a0210ea 
> 
> Diff: https://reviews.apache.org/r/30606/diff/
> 
> 
> Testing
> -------
> 
> Used this function in the context of my implementation of MESOS-2072 and MESOS-2074. It correctly reported the content length from an HTTP server constructed from libprocess primitives.
> 
> 
> Thanks,
> 
> Bernd Mathiske
> 
>