Compare commits
9 Commits
79eb0cc9a8
...
2f1caebaae
Author | SHA1 | Date | |
---|---|---|---|
2f1caebaae | |||
77327e7c2d | |||
16ffb6848f | |||
917c689fd4 | |||
a4c0a7f0e2 | |||
523bc444ca | |||
b4572c6217 | |||
fb8896bccd | |||
dd29f9096a |
|
@ -62,13 +62,13 @@ to `slcl`. If required, encryption should be done before uploading e.g.: using
|
|||
#### Mandatory packages
|
||||
|
||||
```sh
|
||||
sudo apt install build-essential libcjson-dev libssl-dev
|
||||
sudo apt install build-essential libcjson-dev libssl-dev m4 jq
|
||||
```
|
||||
|
||||
#### Optional packages
|
||||
|
||||
```sh
|
||||
sudo apt install cmake xxd jq
|
||||
sudo apt install cmake
|
||||
```
|
||||
|
||||
## How to use
|
||||
|
|
18
page.c
18
page.c
|
@ -1370,7 +1370,15 @@ static int serve_file(struct http_response *const r,
|
|||
dynstr_init(&b);
|
||||
dynstr_init(&d);
|
||||
|
||||
if (dynstr_append(&b, "%s", res))
|
||||
if (preview)
|
||||
{
|
||||
if (dynstr_append(&d, "inline"))
|
||||
{
|
||||
fprintf(stderr, "%s: dynstr_append inline failed\n", __func__);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else if (dynstr_append(&b, "%s", res))
|
||||
{
|
||||
fprintf(stderr, "%s: dynstr_append res failed\n", __func__);
|
||||
goto end;
|
||||
|
@ -1380,14 +1388,6 @@ static int serve_file(struct http_response *const r,
|
|||
fprintf(stderr, "%s: basename(3) failed\n", __func__);
|
||||
goto end;
|
||||
}
|
||||
else if (preview)
|
||||
{
|
||||
if (dynstr_append(&d, "inline"))
|
||||
{
|
||||
fprintf(stderr, "%s: dynstr_append inline failed\n", __func__);
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
else if (dynstr_append(&d, "attachment; filename=\"%s\"", bn))
|
||||
{
|
||||
fprintf(stderr, "%s: dynstr_append attachment failed\n", __func__);
|
||||
|
|
Loading…
Reference in New Issue
Block a user