2014-09-21 11:28:06 +02:00
|
|
|
/*
|
|
|
|
* nghttp2 - HTTP/2 C Library
|
|
|
|
*
|
2015-03-05 13:42:48 +01:00
|
|
|
* Copyright (c) 2015 Tatsuhiro Tsujikawa
|
2014-09-21 11:28:06 +02:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
* a copy of this software and associated documentation files (the
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
* permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
* the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be
|
|
|
|
* included in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
2015-03-05 13:42:48 +01:00
|
|
|
#ifndef ASIO_SERVER_REQUEST_IMPL_H
|
|
|
|
#define ASIO_SERVER_REQUEST_IMPL_H
|
2014-09-21 11:28:06 +02:00
|
|
|
|
|
|
|
#include "nghttp2_config.h"
|
|
|
|
|
2015-03-03 18:43:13 +01:00
|
|
|
#include <nghttp2/asio_http2_server.h>
|
2015-12-16 18:38:21 +01:00
|
|
|
#include <boost/asio/ip/tcp.hpp>
|
2014-09-21 11:28:06 +02:00
|
|
|
|
|
|
|
namespace nghttp2 {
|
|
|
|
namespace asio_http2 {
|
|
|
|
namespace server {
|
|
|
|
|
2015-03-05 13:42:48 +01:00
|
|
|
class stream;
|
2014-09-21 11:28:06 +02:00
|
|
|
|
2015-03-05 13:42:48 +01:00
|
|
|
class request_impl {
|
2014-09-21 11:28:06 +02:00
|
|
|
public:
|
2015-03-05 13:42:48 +01:00
|
|
|
request_impl();
|
|
|
|
|
|
|
|
void header(header_map h);
|
|
|
|
const header_map &header() const;
|
|
|
|
header_map &header();
|
|
|
|
|
|
|
|
void method(std::string method);
|
|
|
|
const std::string &method() const;
|
|
|
|
|
|
|
|
const uri_ref &uri() const;
|
|
|
|
uri_ref &uri();
|
|
|
|
|
|
|
|
void on_data(data_cb cb);
|
|
|
|
|
|
|
|
void stream(class stream *s);
|
|
|
|
void call_on_data(const uint8_t *data, std::size_t len);
|
2014-11-27 15:39:04 +01:00
|
|
|
|
2015-12-19 14:08:15 +01:00
|
|
|
const boost::asio::ip::tcp::endpoint &remote_endpoint() const;
|
2015-12-16 18:38:21 +01:00
|
|
|
void remote_endpoint(boost::asio::ip::tcp::endpoint ep);
|
|
|
|
|
2016-02-04 15:05:05 +01:00
|
|
|
size_t header_buffer_size() const;
|
|
|
|
void update_header_buffer_size(size_t len);
|
|
|
|
|
2014-09-21 11:28:06 +02:00
|
|
|
private:
|
2015-03-05 13:42:48 +01:00
|
|
|
class stream *strm_;
|
|
|
|
header_map header_;
|
|
|
|
std::string method_;
|
|
|
|
uri_ref uri_;
|
|
|
|
data_cb on_data_cb_;
|
2015-12-16 18:38:21 +01:00
|
|
|
boost::asio::ip::tcp::endpoint remote_ep_;
|
2016-02-04 15:05:05 +01:00
|
|
|
size_t header_buffer_size_;
|
2014-09-21 11:28:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace server
|
|
|
|
} // namespace asio_http2
|
|
|
|
} // namespace nghttp2
|
|
|
|
|
2015-03-05 13:42:48 +01:00
|
|
|
#endif // ASIO_SERVER_REQUEST_IMPL_H
|