300{
301 std::string s;
302
303#if 0
304 epee::levin::bucket_head2 req_head;
312 FILE *f=fopen("/tmp/out.levin", "w");
313 fwrite(&req_head,sizeof(req_head),1, f);
314 fclose(f);
315#endif
317 {
318 std::cout << "Error: failed to load file " << filename << std::endl;
319 return 1;
320 }
321 try
322 {
323
324 boost::asio::io_service io_service;
326 test_levin_commands_handler *m_pcommands_handler = new test_levin_commands_handler();
327 m_handler_config.set_handler(m_pcommands_handler, [](epee::levin::levin_commands_handler<test_levin_connection_context> *handler) { delete handler; });
328 std::unique_ptr<test_connection> conn(
new test_connection(io_service, m_handler_config));
329 conn->start();
330
331
332 conn->m_protocol_handler.handle_recv(s.data(), s.size());
333 }
334 catch (const std::exception &e)
335 {
336 std::cerr << "Failed to test http client: " << e.what() << std::endl;
337 return 1;
338 }
339 return 0;
340}
#define LEVIN_PROTOCOL_VER_1
#define LEVIN_PACKET_REQUEST
bool load_file_to_string(const std::string &path_to_file, std::string &target_str, size_t max_size=1000000000)
epee::levin::async_protocol_handler_config< test_connection_context > test_levin_protocol_handler_config
epee::net_utils::connection< test_levin_protocol_handler > test_connection
uint32_t m_protocol_version
bool m_have_to_return_data