示例#1
0
 virtual void dispatch(context_type ctx,
                       const std::string & path,
                       std::string::const_iterator segment_begin,
                       std::string::const_iterator segment_end)
 {
     ctx.write_response(response_);
 }
示例#2
0
 virtual void dispatch(context_type ctx,
                       const std::string & path,
                       std::string::const_iterator segment_begin,
                       std::string::const_iterator segment_end)
 {
     boost::shared_ptr<response_type> response(boost::make_shared<response_type>());
     response->headers.at<headers::content_type>() = type_;
     boost::interprocess::file_mapping mapping((path_ + std::string(segment_end, path.end())).c_str(), boost::interprocess::read_only);
     response->body = boost::make_shared<boost::interprocess::mapped_region>(mapping, boost::interprocess::read_only);
     ctx.write_response(response);
 }