chore: properly compile picohttpparser in lnm; remove old http header
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/docker Pipeline was successful

files
This commit is contained in:
Jef Roosens 2023-12-07 11:02:20 +01:00
parent c59dd29648
commit cc9dc6aec5
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
18 changed files with 30 additions and 1484 deletions

View file

@ -4,8 +4,6 @@
#include "lnm/common.h"
#include "lsm/store.h"
#include "http/types.h"
#include "http_loop.h"
#include "lander.h"
const char lander_key_charset[] =

View file

@ -3,13 +3,10 @@
#include "lnm/http/consts.h"
#include "lnm/http/loop.h"
#include "lnm/loop.h"
#include "lsm/store.h"
#include "event_loop.h"
#include "http/res.h"
#include "http/types.h"
#include "lander.h"
#include "log.h"
#include "lsm/store.h"
static const char index_page[] =
"<!DOCTYPE html>\n"
@ -156,25 +153,3 @@ lnm_http_step_err lander_get_entry(lnm_http_conn *conn) {
return res;
}
bool lander_stream_body_to_client(event_loop_conn *conn) {
http_loop_ctx *ctx = conn->ctx;
lander_ctx *c_ctx = ctx->c;
if ((c_ctx->entry == NULL) ||
(ctx->res.body.expected_len == ctx->res.body.len)) {
return true;
}
uint64_t to_write = MIN(EVENT_LOOP_BUFFER_SIZE - conn->wbuf_size,
ctx->res.body.expected_len - ctx->res.body.len);
uint64_t read = 0;
lsm_entry_data_read(&read, (char *)&conn->wbuf[conn->wbuf_size], c_ctx->entry,
to_write);
ctx->res.body.len += read;
conn->wbuf_size += read;
return false;
}

View file

@ -1,10 +1,9 @@
#include "http/res.h"
#include "http/types.h"
#include "lander.h"
#include "lnm/loop.h"
#include "log.h"
#include "lsm/store.h"
#include "lander.h"
#include "log.h"
static void randomize_key(char *key, int len) {
size_t charset_len = strlen(lander_key_charset);

View file

@ -1,16 +1,17 @@
#include <string.h>
#include "lander.h"
#include "lnm/http/loop.h"
#include "lnm/loop.h"
#include "lander.h"
lnm_http_step_err lander_stream_body_to_entry(lnm_http_conn *conn) {
lnm_http_loop_ctx *ctx = conn->ctx;
lander_ctx *c_ctx = ctx->c;
uint64_t to_append =
MIN(conn->r.size - conn->r.read,
ctx->req.body.expected_len - lsm_entry_data_len(c_ctx->entry));
LNM_MIN(conn->r.size - conn->r.read,
ctx->req.body.expected_len - lsm_entry_data_len(c_ctx->entry));
lsm_str *data;
lsm_str_init_copy_n(&data, (char *)&conn->r.buf[conn->r.read], to_append);