aboutsummaryrefslogtreecommitdiff
path: root/gmid.h
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-10-07 10:47:02 +0000
committerOmar Polo <op@omarpolo.com>2021-10-07 10:47:02 +0000
commit4cd25209651f224be8c34d6006ef689963ce37d5 (patch)
tree039725d48dacf6ac3d5d0115f30da1c63ad1f732 /gmid.h
parent3096da4ef4418dc57f3e0b1fb1f89dceb2ca426a (diff)
one FastCGI connection per client
FastCGI is designed to multiplex requests over a single connection, so ideally the server can open only one connection per worker to the FastCGI application and that's that. Doing this kind of multiplexing makes the code harder to follow and easier to break/leak etc on the gmid side however. OpenBSD' httpd seems to open one connection per client, so why can't we too? One connection per request is still way better (lighter) than using CGI, and we can avoid all the pitfalls of the multiplexing (keeping track of "live ids", properly shut down etc...)
Diffstat (limited to 'gmid.h')
-rw-r--r--gmid.h16
1 files changed, 1 insertions, 15 deletions
diff --git a/gmid.h b/gmid.h
index 53fbca9..43c684f 100644
--- a/gmid.h
+++ b/gmid.h
@@ -79,17 +79,6 @@ struct fcgi {
char *path;
char *port;
char *prog;
- int fd;
-
- struct bufferevent *bev;
-
- /* number of pending clients */
- int pending;
-
-#define FCGI_OFF 0
-#define FCGI_INFLIGHT 1
-#define FCGI_READY 2
- int s;
};
extern struct fcgi fcgi[FCGI_MAX];
@@ -230,7 +219,6 @@ struct client {
int fd, pfd;
struct dirent **dir;
int dirlen, diroff;
- int fcgi;
/* big enough to store STATUS + SPACE + META + CRLF */
char sbuf[1029];
@@ -366,12 +354,10 @@ int recv_fd(int);
int executor_main(struct imsgbuf*);
/* fcgi.c */
-void fcgi_abort_request(struct client *);
-void fcgi_close_backend(struct fcgi *);
void fcgi_read(struct bufferevent *, void *);
void fcgi_write(struct bufferevent *, void *);
void fcgi_error(struct bufferevent *, short, void *);
-void fcgi_req(struct fcgi *, struct client *);
+void fcgi_req(struct client *);
/* sandbox.c */
void sandbox_server_process(void);