summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2022-01-06 19:06:37 +0100
committerRoland Reichwein <mail@reichwein.it>2022-01-06 19:06:37 +0100
commit491e246f65ddb4ec7d0e810f47b7db537be4c382 (patch)
treeed2922e7f5b31b776e25f0c7aa1c360b3b054f6a
parent501d04c22e76152da8ff009d3a9b017fc75e8dcc (diff)
Bugfix for CGI: Process readv1.16
-rw-r--r--debian/changelog6
-rw-r--r--plugins/cgi/cgi.cpp3
-rw-r--r--webserver.conf8
-rw-r--r--webserver.cpp2
4 files changed, 16 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index ad2e1f2..e755901 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+webserver (1.16~pre1) UNRELEASED; urgency=medium
+
+ * Support CGIT via CGI
+
+ -- Roland Reichwein <mail@reichwein.it> Thu, 06 Jan 2022 18:51:52 +0100
+
webserver (1.15) unstable; urgency=medium
* Improve MIME handling
diff --git a/plugins/cgi/cgi.cpp b/plugins/cgi/cgi.cpp
index 131855e..b2af9fa 100644
--- a/plugins/cgi/cgi.cpp
+++ b/plugins/cgi/cgi.cpp
@@ -157,7 +157,6 @@ namespace {
std::string output;
std::string line;
- // TODO: C++20 coroutine
coro_t::push_type processLine( [&](coro_t::pull_type& in){
std::string line;
// read header lines
@@ -183,7 +182,7 @@ namespace {
throw std::runtime_error("Input missing on processing CGI body");
});
- while (child.running() && std::getline(is_out, line)) {
+ while (std::getline(is_out, line) && !is_out.eof()) {
processLine(line);
}
diff --git a/webserver.conf b/webserver.conf
index 5e97cd2..81da39b 100644
--- a/webserver.conf
+++ b/webserver.conf
@@ -115,6 +115,14 @@
<plugin>cgi</plugin>
<target>/home/ernie/code/webserver/cgi-bin</target>
</path>
+ <path requested="/cgit">
+ <plugin>cgi</plugin>
+ <target>/usr/lib/cgit/cgit.cgi</target>
+ </path>
+ <path requested="/cgit-css">
+ <plugin>static-files</plugin>
+ <target>/usr/share/cgit</target>
+ </path>
<certpath>/home/ernie/code/webserver/cert.pem</certpath>
<keypath>/home/ernie/code/webserver/key.pem</keypath>
</site>
diff --git a/webserver.cpp b/webserver.cpp
index c832ec8..e848fd1 100644
--- a/webserver.cpp
+++ b/webserver.cpp
@@ -15,7 +15,7 @@ void usage()
std::cout << " webserver [-c <configuration-filename>] - start server with specified configuration\n"
" file or default /etc/webserver.conf" << std::endl;
std::cout << " webserver -p <password> - encrypt password for basic HTTP AUTH,\n"
- " suitable for config file" << std::endl;
+ " suitable for config file, and exit" << std::endl;
}
void initlocale() {