Reasonably sure :)  waiting_stream is set in the handler using cowboy_req:set- see test/http_SUITE_data/http_streamed.erl for an example (copied below) - it's called in the streamed_response test in the http_SUITE

%% Feel free to use, reuse and abuse the code in this file.

-module(http_streamed).
-behaviour(cowboy_http_handler).
-export([init/3, handle/2, terminate/3]).

init({_Transport, http}, Req, _Opts) ->
{ok, Req, undefined}.

handle(Req, State) ->
    Req2 = cowboy_req:set([{resp_state, waiting_stream}], Req),
    {ok, Req3} = cowboy_req:chunked_reply(200, Req2),
    timer:sleep(100),
    cowboy_req:chunk("streamed_handler\r\n", Req3),
    timer:sleep(100),
    cowboy_req:chunk("works fine!", Req3),
    {ok, Req3, State}.

terminate(_, _, _) ->
ok.



--  
Dr Adrian Roe
Director


On Saturday, 29 June 2013 at 18:45, Loïc Hoguin wrote:

> In manual/cowboy_req.md (http://cowboy_req.md):
> > @@ -443,7 +443,10 @@ Response related exports > > > > If the request uses HTTP/1.0, the data is sent directly > > without wrapping it in an HTTP/1.1 chunk, providing > -> compatibility with older clients. > +> compatibility with older clients. You can also force > +> HTTP/1.0-like behaviour by calling > +> `cowboy_req:set([{resp_state, waiting_streaming}], Req)`, > +> to allow compatability with some non-compliant clients.  
> No we don't want it documented. :)
>  
> —
> Reply to this email directly or view it on GitHub (https://github.com/extend/cowboy/pull/548/files#r4952576).
>  
>  
>