]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_fcgi.h
buildsys: switch source download to quincy
[ceph.git] / ceph / src / rgw / rgw_fcgi.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
3
4 #ifndef CEPH_RGW_FCGI_H
5 #define CEPH_RGW_FCGI_H
6
7 #include "acconfig.h"
8 #include <fcgiapp.h>
9
10 #include "rgw_client_io.h"
11
12 struct FCGX_Request;
13
14 class RGWFCGX : public rgw::io::RestfulClient,
15 public rgw::io::BuffererSink {
16 FCGX_Request *fcgx;
17 RGWEnv env;
18
19 rgw::io::StaticOutputBufferer<> txbuf;
20
21 size_t read_data(char* buf, size_t len);
22 size_t write_data(const char* buf, size_t len) override;
23
24 public:
25 explicit RGWFCGX(FCGX_Request* const fcgx)
26 : fcgx(fcgx),
27 txbuf(*this) {
28 }
29
30 int init_env(CephContext* cct) override;
31 size_t send_status(int status, const char* status_name) override;
32 size_t send_100_continue() override;
33 size_t send_header(const std::string_view& name,
34 const std::string_view& value) override;
35 size_t send_content_length(uint64_t len) override;
36 size_t complete_header() override;
37
38 size_t recv_body(char* buf, size_t max) override {
39 return read_data(buf, max);
40 }
41
42 size_t send_body(const char* buf, size_t len) override {
43 return write_data(buf, len);
44 }
45
46 void flush() override;
47
48 RGWEnv& get_env() noexcept override {
49 return env;
50 }
51
52 size_t complete_request() override {
53 return 0;
54 }
55 };
56
57 #endif