From d2efac3ce2f923a8917453b39b4b2174d47230f9 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Sat, 7 Jan 2023 04:06:31 +0000 Subject: [PATCH] some minor touch-up only --- lib/fcgi-cli.c | 10 +++++++--- lib/hio-htrd.h | 4 ++-- lib/http-fcgi.c | 9 ++------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/fcgi-cli.c b/lib/fcgi-cli.c index de854ce..2015892 100644 --- a/lib/fcgi-cli.c +++ b/lib/fcgi-cli.c @@ -27,8 +27,6 @@ #include "hio-prv.h" - - typedef struct hio_svc_fcgic_conn_t hio_svc_fcgic_conn_t; struct hio_svc_fcgic_t @@ -292,7 +290,7 @@ static hio_svc_fcgic_sess_t* new_session (hio_svc_fcgic_t* fcgic, const hio_skad hio_svc_fcgic_sess_t* newptr; newcapa = conn->sess.capa + CONN_SESS_INC; - newptr = hio_reallocmem (hio, conn->sess.ptr, HIO_SIZEOF(*sess) * newcapa); + newptr = hio_reallocmem(hio, conn->sess.ptr, HIO_SIZEOF(*sess) * newcapa); if (HIO_UNLIKELY(!newptr)) return HIO_NULL; for (i = conn->sess.capa ; i < newcapa; i++) @@ -377,3 +375,9 @@ int hio_svc_fcgic_write (hio_svc_fcgic_sess_t* sess, const void* data, hio_iolen { return 0; } + + +int hio_svc_fcgic_beginreq (hio_svc_fcgic_sess_t* sess) +{ + +} \ No newline at end of file diff --git a/lib/hio-htrd.h b/lib/hio-htrd.h index 666f96a..19122db 100644 --- a/lib/hio-htrd.h +++ b/lib/hio-htrd.h @@ -67,8 +67,8 @@ typedef struct hio_htrd_recbs_t hio_htrd_recbs_t; struct hio_htrd_recbs_t { - int (*peek) (hio_htrd_t* htrd, hio_htre_t* re); - int (*poke) (hio_htrd_t* htrd, hio_htre_t* re); + int (*peek) (hio_htrd_t* htrd, hio_htre_t* re); /* called when the end of a request header is seen. */ + int (*poke) (hio_htrd_t* htrd, hio_htre_t* re); /* called when a complete request is read including content */ int (*push_content) (hio_htrd_t* htrd, hio_htre_t* re, const hio_bch_t* data, hio_oow_t len); }; diff --git a/lib/http-fcgi.c b/lib/http-fcgi.c index 9088fe6..958d135 100644 --- a/lib/http-fcgi.c +++ b/lib/http-fcgi.c @@ -286,11 +286,10 @@ static int fcgi_send_final_status_to_client (fcgi_t* fcgi, int status_code, int (force_close && fcgi_write_to_client(fcgi, HIO_NULL, 0) <= -1))? -1: 0; } - - static int fcgi_client_htrd_poke (hio_htrd_t* htrd, hio_htre_t* req) { /* client request got completed */ + hio_svc_htts_cli_htrd_xtn_t* htrdxtn = (hio_svc_htts_cli_htrd_xtn_t*)hio_htrd_getxtn(htrd); hio_dev_sck_t* sck = htrdxtn->sck; hio_svc_htts_cli_t* cli = hio_dev_sck_getxtn(sck); @@ -314,6 +313,7 @@ static int fcgi_client_htrd_push_content (hio_htrd_t* htrd, hio_htre_t* req, con hio_svc_htts_cli_t* cli = hio_dev_sck_getxtn(sck); fcgi_t* fcgi = (fcgi_t*)cli->rsrc; +/* TODO: THIS must be written to the peer as FCGI_DATA */ HIO_ASSERT (sck->hio, cli->sck == sck); return fcgi_write_to_peer(fcgi, data, dlen); } @@ -325,7 +325,6 @@ static hio_htrd_recbs_t fcgi_client_htrd_recbs = fcgi_client_htrd_push_content }; - static void fcgi_client_on_disconnect (hio_dev_sck_t* sck) { hio_svc_htts_cli_t* cli = hio_dev_sck_getxtn(sck); @@ -442,10 +441,6 @@ oops: return 0; } - - - - static void fcgi_on_kill (fcgi_t* fcgi) { hio_t* hio = fcgi->htts->hio;