summaryrefslogtreecommitdiff
path: root/src/CGIScript.h
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2022-09-19 13:47:51 -0600
committercflip <cflip@cflip.net>2022-09-19 13:48:33 -0600
commit2ef8197a75c3d7605279b6c41c2eb3e1643d5374 (patch)
treeaebda710c6ac59132d47554fc5420e2ac6cc16d3 /src/CGIScript.h
parent91c237df6a65f6ec446eea4b89216ad53c9f7e0e (diff)
Refactor the CGIScript class a bit
This allows the user of the class to set environment variables before opening the pipe to the script.
Diffstat (limited to 'src/CGIScript.h')
-rw-r--r--src/CGIScript.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/CGIScript.h b/src/CGIScript.h
index a64c55a..622206d 100644
--- a/src/CGIScript.h
+++ b/src/CGIScript.h
@@ -4,19 +4,18 @@
#include <string>
#include <vector>
-#include "HttpRequest.h"
-
class CGIScript {
public:
- CGIScript(const std::string& path, const HttpRequest&);
+ CGIScript(const std::string& script_path);
~CGIScript();
void set_environment(const char* key, const char* value);
- bool is_open() const { return m_is_open; }
+ bool open();
std::string read_output();
private:
FILE* m_pipe;
+ const std::string& m_script_path;
bool m_is_open{false};
std::vector<const char*> m_environment_variables;