aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-08-21 23:55:21 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-08-22 02:27:34 +0200
commit700ae79d57b1d78551d984ce2dc886a310cc6be8 (patch)
tree51b5a00f28bc5237f00e794234e47c67d6a065c8 /http.c
parent915be88ddcebac61dc06cc47668961b602e01b38 (diff)
http.c: Remove unneeded parameter
This parameter was rendered obsolete after the following commit: commit b0accd099fa8c5110d4c3c68830ad6fd810ca3ec Author: Xavier Del Campo Romero <xavi.dcr@tutanota.com> Date: Fri Nov 24 00:52:50 2023 +0100 http.c: Unify read operations
Diffstat (limited to 'http.c')
-rw-r--r--http.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/http.c b/http.c
index 0b058dc..f6c5d5f 100644
--- a/http.c
+++ b/http.c
@@ -1312,7 +1312,7 @@ static int send_payload(struct http_ctx *const h,
return start_response(h);
}
-static int update_lstate(struct http_ctx *const h, bool *const close,
+static int update_lstate(struct http_ctx *const h,
int (*const f)(struct http_ctx *), const char *const buf,
size_t *const sz)
{
@@ -1932,8 +1932,8 @@ static int read_mf_body_boundary(struct http_ctx *const h,
return 0;
}
-static int read_multiform(struct http_ctx *const h, bool *const close,
- const char *const buf, size_t *const sz)
+static int read_multiform(struct http_ctx *const h, const char *const buf,
+ size_t *const sz)
{
struct multiform *const m = &h->ctx.u.mf;
int res;
@@ -1960,8 +1960,8 @@ static int read_multiform(struct http_ctx *const h, bool *const close,
return 0;
}
-static int read_body_to_mem(struct http_ctx *const h, bool *const close,
- const char *const buf, size_t *const sz)
+static int read_body_to_mem(struct http_ctx *const h, const char *const buf,
+ size_t *const sz)
{
struct ctx *const c = &h->ctx;
struct payload *const p = &c->payload;
@@ -2085,8 +2085,8 @@ static int read_put_body_to_file(struct http_ctx *const h,
return 0;
}
-static int read_to_file(struct http_ctx *const h, bool *const close,
- const char *const buf, size_t *const sz)
+static int read_to_file(struct http_ctx *const h, const char *const buf,
+ size_t *const sz)
{
struct ctx *const c = &h->ctx;
struct payload *const p = &c->payload;
@@ -2117,19 +2117,19 @@ static int read_to_file(struct http_ctx *const h, bool *const close,
return 0;
}
-static int read_body(struct http_ctx *const h, bool *const close,
- const char *const buf, size_t *const sz)
+static int read_body(struct http_ctx *const h, const char *const buf,
+ size_t *const sz)
{
const struct ctx *const c = &h->ctx;
switch (c->op)
{
case HTTP_OP_POST:
- return c->boundary ? read_multiform(h, close, buf, sz)
- : read_body_to_mem(h, close, buf, sz);
+ return c->boundary ? read_multiform(h, buf, sz)
+ : read_body_to_mem(h, buf, sz);
case HTTP_OP_PUT:
- return read_to_file(h, close, buf, sz);
+ return read_to_file(h, buf, sz);
case HTTP_OP_GET:
/* Fall through. */
@@ -2152,18 +2152,18 @@ static int process_line(struct http_ctx *const h)
return state[h->ctx.state](h);
}
-static int read_buf(struct http_ctx *const h, bool *const close,
- const char *const buf, size_t *const sz)
+static int read_buf(struct http_ctx *const h, const char *const buf,
+ size_t *const sz)
{
switch (h->ctx.state)
{
case START_LINE:
/* Fall through. */
case HEADER_CR_LINE:
- return update_lstate(h, close, process_line, buf, sz);
+ return update_lstate(h, process_line, buf, sz);
case BODY_LINE:
- return read_body(h, close, buf, sz);
+ return read_body(h, buf, sz);
}
fprintf(stderr, "%s: unexpected state %d\n", __func__, h->ctx.state);
@@ -2182,7 +2182,7 @@ int http_read(struct http_ctx *const h, bool *const close)
while (rem)
{
- const int ret = read_buf(h, close, &buf[r - rem], &rem);
+ const int ret = read_buf(h, &buf[r - rem], &rem);
if (ret)
{