summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2021-12-26 19:52:31 +0100
committerAnton Luka Šijanec <anton@sijanec.eu>2021-12-26 19:52:31 +0100
commita10a8fb335e5a817e1a9add49ee179394eea67c4 (patch)
tree70ea95120f4390a6a5f32cda5a8bf1d45e4e0487 /src/main.c
parent0.0.16, read debian/changelog (diff)
downloadsear.c-67b2f4aac5401a9184d149d0b1267ad1887facb7.tar
sear.c-67b2f4aac5401a9184d149d0b1267ad1887facb7.tar.gz
sear.c-67b2f4aac5401a9184d149d0b1267ad1887facb7.tar.bz2
sear.c-67b2f4aac5401a9184d149d0b1267ad1887facb7.tar.lz
sear.c-67b2f4aac5401a9184d149d0b1267ad1887facb7.tar.xz
sear.c-67b2f4aac5401a9184d149d0b1267ad1887facb7.tar.zst
sear.c-67b2f4aac5401a9184d149d0b1267ad1887facb7.zip
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 6576fb8..32c7e96 100644
--- a/src/main.c
+++ b/src/main.c
@@ -21,6 +21,9 @@
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <microhttpd.h>
+#ifndef SC_OLD_STORAGE
+#include <search.h>
+#endif
#include <lib.c>
#include <url.c>
unsigned char sc_hp[] = { /* html page null terminated format string, from file src/hp.html */
@@ -39,7 +42,7 @@ char sc_securitytxt[] = "# This content information is provided by the developer
"Encryption: https://www.sijanec.eu/pgp-key.txt\n"
"Expires: Thu, 31 Dec 2021 18:37:07 -0800\n"
"Preferred-Languages: sl, en, de, hr\n";
-#define SC_HTTP_PORT 7327 /* SEAR on mobile keyboard */
+#define SC_HTTP_PORT (getenv("SC_PORT") ? atoi(getenv("SC_PORT")) : 7327) /* SEAR on mobile keyboard */
#define SC_HTTP_RBUFSIZE 4096 /* initial size of http read buffer, increasning by K */
#define SC_HTTP_USER_AGENT "Nokia WAP Gateway 4.1 CD1/ECD13_D/4.1.04)" /* so google and others sends a minimal response */
#define SC_HTTP_HEADERS "User-Agent: " SC_HTTP_USER_AGENT "\r\n"