chore: properly compile picohttpparser in lnm; remove old http header
files
This commit is contained in:
parent
c59dd29648
commit
cc9dc6aec5
18 changed files with 30 additions and 1484 deletions
|
|
@ -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[] =
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue