Skip to content

Reusing http::client::response #552

@tpecholt

Description

@tpecholt

I have a strange issue when reusing existing response object. The code is like this:

http::client::request req(some_path);
req << net::header(...);
http::client::response resp = m_client.get(req);
//now status(resp), headers(resp), resp.body() will block and return correct data
req = http::client::request(some_other_path);
req << net::header(...);
resp = m_client.get(req);
//now headers(resp), resp.body() return data from previous response! 

when I change the last line to this:

http::client::response resp2 = m_client(req);

it will work.

What is the deal here? I would like to reuse same response object as I run requests in parallel and store responses in a single vector. Each iteration on the vector parses previous responses and sends new requests.

My environment:
cpp-netlib 0.11-1-final.zip
boost_1_57_0
VS2013
Win7 x64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions