Skip to content

Unhandled exception at 0x7762C42D in httpclient.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x003FE038. #546

@zcchm

Description

@zcchm
using namespace std;
using namespace boost::network;
using namespace boost::network::http;

void callback(boost::iterator_range<char const*> const &a, boost::system::error_code const &error)
{
    if (!error)
    {
        std::string resp;
        resp.append(boost::begin(a), boost::end(a));
        cout << resp << endl;
    }
}


int _tmain(int argc, _TCHAR* argv[])
{
    boost::shared_ptr<boost::asio::io_service>  io_service = boost::make_shared<boost::asio::io_service>();

    client::request request("http://data.video.qiyi.com/v.f4v");

    client::options options;
    options.io_service(io_service);
    boost::network::string<boost::network::http::tags::http_async_8bit_udp_resolve>::type body("test");
    client client(options);


    client::response response1 = client.post(request, body, callback);

    io_service->run(); // this line caused AV exception

    return 0;
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions