1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef CEPH_RGW_MONGOOSE_H
5 #define CEPH_RGW_MONGOOSE_H
6 #define TIME_BUF_SIZE 128
8 #include "rgw_client_io.h"
13 class RGWCivetWeb : public rgw::io::RestfulClient,
14 public rgw::io::BuffererSink {
20 bool explicit_keepalive;
21 bool explicit_conn_close;
23 rgw::io::StaticOutputBufferer<> txbuf;
25 size_t write_data(const char *buf, size_t len) override;
26 size_t read_data(char *buf, size_t len);
27 size_t dump_date_header();
30 void init_env(CephContext *cct) override;
32 size_t send_status(int status, const char *status_name) override;
33 size_t send_100_continue() override;
34 size_t send_header(const boost::string_ref& name,
35 const boost::string_ref& value) override;
36 size_t send_content_length(uint64_t len) override;
37 size_t complete_header() override;
39 size_t recv_body(char* buf, size_t max) override {
40 return read_data(buf, max);
43 size_t send_body(const char* buf, size_t len) override {
44 return write_data(buf, len);
47 size_t complete_request() override;
49 void flush() override;
51 RGWEnv& get_env() noexcept override {
55 RGWCivetWeb(mg_connection *_conn);