diff --git a/dist/uce_0.1.1.deb b/dist/uce_0.1.1.deb index 5fa24f9..09f08a4 100644 Binary files a/dist/uce_0.1.1.deb and b/dist/uce_0.1.1.deb differ diff --git a/doc/pages/float_val.txt b/doc/pages/float_val.txt new file mode 100644 index 0000000..395cfd9 --- /dev/null +++ b/doc/pages/float_val.txt @@ -0,0 +1,10 @@ +:sig +f64 float_val(String s) + +:params +s : string to be converted +return value : a f64 containing the number (0 if no number could be identified). + +:desc +Extracts a floating point number from a String. + diff --git a/etc/systemd/system/uce.service b/etc/systemd/system/uce.service new file mode 100644 index 0000000..7aff517 --- /dev/null +++ b/etc/systemd/system/uce.service @@ -0,0 +1,15 @@ +[Unit] +Description=UCE FastCGI Server + +Wants=network.target +After=syslog.target network-online.target + +[Service] +Type=simple +ExecStart=/opt/uce/bin/uce_fastcgi.linux.bin +Restart=on-failure +RestartSec=10 +KillMode=mixed + +[Install] +WantedBy=multi-user.target diff --git a/etc/uce/settings.cfg b/etc/uce/settings.cfg new file mode 100644 index 0000000..8a4535b --- /dev/null +++ b/etc/uce/settings.cfg @@ -0,0 +1,20 @@ +# UCE WORKING DIRECTORIES +BIN_DIRECTORY=/tmp/uce/work +TMP_UPLOAD_PATH=/tmp/uce/uploads +SESSION_PATH=/tmp/uce/sessions + +# LISTEN ON SOCKETS +SOCKET_PATH=/run/uce.sock +LISTEN_PORT=9993 + +# PRECOMPILE .uce FILES +PRECOMPILE_FILES_IN= + +# SPAWN WORKERS +WORKER_COUNT=4 + +# MAX MEMORY PER REQUEST +MAX_MEMORY=16777216 + +# LIFETIME OF SESSION COOKIES IN SECONDS +SESSION_TIME=2592000 diff --git a/scripts/make_deb.sh b/scripts/make_deb.sh index e12c549..417d146 100755 --- a/scripts/make_deb.sh +++ b/scripts/make_deb.sh @@ -29,11 +29,12 @@ cp scripts/control "pkg/$PKG_NAME/DEBIAN/" echo "Version: $VERSION" >> "pkg/$PKG_NAME/DEBIAN/control" echo "" >> "pkg/$PKG_NAME/DEBIAN/control" -cp -r bin "pkg/$PKG_NAME/opt/" -cp -r doc "pkg/$PKG_NAME/opt/" -cp -r examples "pkg/$PKG_NAME/opt/" -cp -r scripts "pkg/$PKG_NAME/opt/" -cp -r test "pkg/$PKG_NAME/opt/" +cp -r bin "pkg/$PKG_NAME/opt/uce/" +cp -r doc "pkg/$PKG_NAME/opt/uce/" +cp -r examples "pkg/$PKG_NAME/opt/uce/" +cp -r scripts "pkg/$PKG_NAME/opt/uce/" +cp -r test "pkg/$PKG_NAME/opt/uce/" +cp -r etc "pkg/$PKG_NAME/" du -sh "pkg/$PKG_NAME/"* diff --git a/src/lib/functionlib.cpp b/src/lib/functionlib.cpp index a97a207..c661fcd 100644 --- a/src/lib/functionlib.cpp +++ b/src/lib/functionlib.cpp @@ -150,7 +150,7 @@ StringMap split_kv(String s, char separator, bool trim_whitespace) u8 mode = 0; k = ""; v = ""; - for(auto c : s) + if(s[0] != '#') for(auto c : s) { if(mode == 0) { @@ -309,7 +309,12 @@ String html_escape(f64 a) u64 int_val(String s, u32 base) { - return(strtoll(s.c_str(), 0, base)); + return(strtol(s.c_str(), 0, base)); +} + +f64 float_val(String s) +{ + return(strtod(s.c_str(), 0)); } String nibble(String& haystack, String delim) diff --git a/src/lib/functionlib.h b/src/lib/functionlib.h index 436bc55..1549ae1 100644 --- a/src/lib/functionlib.h +++ b/src/lib/functionlib.h @@ -2,6 +2,7 @@ u8 char_to_u8(char input); u8 hex_to_u8(String src); u64 int_val(String s, u32 base = 10); +f64 float_val(String s); String to_lower(String s); String to_upper(String s); String replace(String s, String search, String replace_with);