From 259759d8725f050d6598d3ad4368e5edf124b089 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 16 Jun 2018 12:52:43 -0400 Subject: Return to working version mode --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 44c6873f..54eac40e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([urweb], [20180616]) -WORKING_VERSION=0 +WORKING_VERSION=1 AC_USE_SYSTEM_EXTENSIONS # automake 1.12 requires this, but automake 1.11 doesn't recognize it -- cgit v1.2.3 From 765c39bea005eaa49852ac1f877ed042ab5b68e6 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Wed, 7 Nov 2018 15:10:40 -0500 Subject: Use our own memmem only when libc doesn’t have one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Systems without memmem(3) are getting rarer every day. We can improve clarity and efficiency by relying on libc’s memmem whenever possible. Detect at compile time whether the system supports memmem(3); if it does, simply reexport its prototype through memmem.h and emit no code. If it doesn’t, actually build in the memmem code in memmem.c. Along the way, undo the renaming from commit 6dad7c645d8fdb7b7237c89ff7b34e90adbb86b1. Since we’re only creating a memmem prototype if libc doesn’t define the symbol, our prototype should never clash with libc’s. As before, authors should not assume string.h provides a prototype for memmem; they should `#include "memmem.h"` if they use the function. --- configure.ac | 2 ++ src/c/memmem.c | 15 ++++++--------- src/c/memmem.h | 23 +++++++++++++++++++++++ src/c/request.c | 5 ++--- 4 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 src/c/memmem.h (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 54eac40e..75bba230 100644 --- a/configure.ac +++ b/configure.ac @@ -111,6 +111,8 @@ pthread_t a; AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) +AC_CHECK_FUNCS_ONCE([memmem]) + AC_SUBST(CC) AC_SUBST(BIN) AC_SUBST(LIB) diff --git a/src/c/memmem.c b/src/c/memmem.c index f31f4e31..efddd0c1 100644 --- a/src/c/memmem.c +++ b/src/c/memmem.c @@ -1,4 +1,6 @@ -#include "config.h" +#include "memmem.h" + +#ifndef HAVE_MEMMEM /* $NetBSD$ */ @@ -38,8 +40,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -// Function renamed by Adam Chlipala in 2016. - #include #if defined(LIBC_SCCS) && !defined(lint) __RCSID("$NetBSD$"); @@ -54,13 +54,8 @@ __RCSID("$NetBSD$"); #define NULL ((char *)0) #endif -/* - * urweb_memmem() returns the location of the first occurence of data - * pattern b2 of size len2 in memory block b1 of size len1 or - * NULL if none is found. - */ void * -urweb_memmem(const void *b1, size_t len1, const void *b2, size_t len2) +memmem(const void *b1, size_t len1, const void *b2, size_t len2) { /* Sanity check */ if(!(b1 != NULL && b2 != NULL && len1 != 0 && len2 != 0)) @@ -85,3 +80,5 @@ urweb_memmem(const void *b1, size_t len1, const void *b2, size_t len2) return NULL; } + +#endif // !defined(HAVE_MEMMEM) diff --git a/src/c/memmem.h b/src/c/memmem.h new file mode 100644 index 00000000..0ddbb494 --- /dev/null +++ b/src/c/memmem.h @@ -0,0 +1,23 @@ +#ifndef URWEB_MEMMEM_H +#define URWEB_MEMMEM_H + +#include "config.h" + +#ifdef HAVE_MEMMEM + +#include + +#else // !defined(HAVE_MEMMEM) + +#include + +/* + * memmem() returns the location of the first occurence of data + * pattern b2 of size len2 in memory block b1 of size len1 or + * NULL if none is found. + */ +void *memmem(const void *b1, size_t len1, const void *b2, size_t len2); + +#endif // !defined(HAVE_MEMMEM) + +#endif // URWEB_MEMMEM_H diff --git a/src/c/request.c b/src/c/request.c index 3e7ac34c..195b3cdc 100644 --- a/src/c/request.c +++ b/src/c/request.c @@ -11,13 +11,12 @@ #include +#include "memmem.h" #include "urweb.h" #include "request.h" #define MAX_RETRIES 5 -void *urweb_memmem(const void *b1, size_t len1, const void *b2, size_t len2); - static int try_rollback(uw_context ctx, int will_retry, void *logger_data, uw_logger log_error) { int r = uw_rollback(ctx, will_retry); @@ -422,7 +421,7 @@ request_result uw_request(uw_request_context rc, uw_context ctx, } } - part = urweb_memmem(after_sub_headers, body + body_len - after_sub_headers, boundary, boundary_len); + part = memmem(after_sub_headers, body + body_len - after_sub_headers, boundary, boundary_len); if (!part) { log_error(logger_data, "Missing boundary after multipart payload\n"); return FAILED; -- cgit v1.2.3 From 3f70998a08b5169b3846537a8b6114465fca2b1a Mon Sep 17 00:00:00 2001 From: fab Date: Mon, 17 Dec 2018 21:41:10 +0000 Subject: test2 --- .travis.yml | 4 +--- configure.ac | 1 + src/c/Makefile.am | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/.travis.yml b/.travis.yml index eaeefd7e..2c798801 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,9 +21,7 @@ before_install: - if command -v brew &>/dev/null; then brew uninstall libtool; fi - if command -v brew &>/dev/null; then brew install libtool; fi - if command -v brew &>/dev/null; then brew install openssl mlton icu4c; fi - - if command -v brew &>/dev/null; then brew ls --verbose icu4c; fi - - if command -v brew &>/dev/null; then brew --prefix icu4c; fi - - if command -v brew &>/dev/null; then brew unlink icu4c && brew link icu4c; fi + - if command -v brew &>/dev/null; then export ICU_INCLUDES=`brew --prefix icu4c`/include; fi - if command -v brew &>/dev/null; then export CONFIGURE_ARGS="--with-openssl=/usr/local/opt/openssl"; fi diff --git a/configure.ac b/configure.ac index 54eac40e..bd52aa4c 100644 --- a/configure.ac +++ b/configure.ac @@ -125,6 +125,7 @@ AC_SUBST(SQHEADER) AC_SUBST(VERSION) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LIBS) +AC_SUBST(ICU_INCLUDES) AC_CONFIG_FILES([ Makefile diff --git a/src/c/Makefile.am b/src/c/Makefile.am index 96c1d92f..8a2a81ec 100644 --- a/src/c/Makefile.am +++ b/src/c/Makefile.am @@ -6,7 +6,7 @@ liburweb_cgi_la_SOURCES = cgi.c liburweb_fastcgi_la_SOURCES = fastcgi.c fastcgi.h liburweb_static_la_SOURCES = static.c -AM_CPPFLAGS = -I$(srcdir)/../../include/urweb $(OPENSSL_INCLUDES) +AM_CPPFLAGS = -I$(srcdir)/../../include/urweb $(OPENSSL_INCLUDES) $(ICU_INCLUDES) AM_CFLAGS = -Wall -Wunused-parameter -Werror -Wno-format-security -Wno-deprecated-declarations -U_FORTIFY_SOURCE $(PTHREAD_CFLAGS) liburweb_la_LDFLAGS = $(AM_LDFLAGS) $(OPENSSL_LDFLAGS) \ -export-symbols-regex '^(client_pruner|pthread_create_big|strcmp_nullsafe|uw_.*)' \ -- cgit v1.2.3 From 757e40719735a45085343e90b53674b9b276b5cb Mon Sep 17 00:00:00 2001 From: fab Date: Mon, 17 Dec 2018 22:25:59 +0000 Subject: test 5 --- configure.ac | 1 + src/compiler.sml | 4 ++-- src/config.sig | 3 +++ src/config.sml.in | 3 +++ src/settings.sig | 1 + src/settings.sml | 2 +- 6 files changed, 11 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index bd52aa4c..d6b1c98f 100644 --- a/configure.ac +++ b/configure.ac @@ -126,6 +126,7 @@ AC_SUBST(VERSION) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_LIBS) AC_SUBST(ICU_INCLUDES) +AC_SUBST(ICU_LIBS) AC_CONFIG_FILES([ Makefile diff --git a/src/compiler.sml b/src/compiler.sml index 9ee88c9b..06615bcf 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -1585,9 +1585,9 @@ fun compileC {cname, oname, ename, libs, profile, debug, linker, link = link'} = val proto = Settings.currentProtocol () val lib = if Settings.getBootLinking () then - !Settings.configLib ^ "/" ^ #linkStatic proto ^ " " ^ !Settings.configLib ^ "/liburweb.a -licui18n -licuuc -licudata" + !Settings.configLib ^ "/" ^ #linkStatic proto ^ " " ^ !Settings.configLib ^ "/liburweb.a " ^ !Settings.configIcuLibs ^ " -licui18n -licuuc -licudata" else if Settings.getStaticLinking () then - " -static " ^ !Settings.configLib ^ "/" ^ #linkStatic proto ^ " " ^ !Settings.configLib ^ "/liburweb.a -licui18n -licuuc -licudata" + " -static " ^ !Settings.configLib ^ "/" ^ #linkStatic proto ^ " " ^ !Settings.configLib ^ "/liburweb.a " ^ !Settings.configIcuLibs ^ " -licui18n -licuuc -licudata" else "-L" ^ !Settings.configLib ^ " " ^ #linkDynamic proto ^ " -lurweb" diff --git a/src/config.sig b/src/config.sig index a3ad7d76..be72a8cc 100644 --- a/src/config.sig +++ b/src/config.sig @@ -20,4 +20,7 @@ signature CONFIG = sig val pthreadCflags : string val pthreadLibs : string + + val icuIncludes : string + val icuLibs : string end diff --git a/src/config.sml.in b/src/config.sml.in index ebcdb7b6..2d12e28d 100644 --- a/src/config.sml.in +++ b/src/config.sml.in @@ -28,6 +28,9 @@ val pgheader = "@PGHEADER@" val msheader = "@MSHEADER@" val sqheader = "@SQHEADER@" +val icuIncludes = "@ICU_INCLUDES@" +val icuLibs = "@ICU_LIBS@" + val versionNumber = "@VERSION@" val versionString = "The Ur/Web compiler, version " ^ versionNumber diff --git a/src/settings.sig b/src/settings.sig index 986d6ed7..22dc80a2 100644 --- a/src/settings.sig +++ b/src/settings.sig @@ -37,6 +37,7 @@ signature SETTINGS = sig val configSrcLib : string ref val configInclude : string ref val configSitelisp : string ref + val configIcuLibs : string ref val libUr : unit -> string val libC : unit -> string diff --git a/src/settings.sml b/src/settings.sml index cfbe98a5..8ae2d377 100644 --- a/src/settings.sml +++ b/src/settings.sml @@ -32,7 +32,7 @@ val configLib = ref Config.lib val configSrcLib = ref Config.srclib val configInclude = ref Config.includ val configSitelisp = ref Config.sitelisp - +val configIcuLibs = ref Config.icuLibs val configCCompiler = ref Config.ccompiler fun getCCompiler () = !configCCompiler -- cgit v1.2.3 From c19f3908ab5b18387e31b53ed6ac279daa9b4695 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Wed, 19 Dec 2018 10:55:37 -0500 Subject: Follow-up to #146: configure tests if ICU is available --- configure.ac | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 696aac84..7e069d0f 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,18 @@ if test [-z $SQHEADER]; then SQHEADER=sqlite3.h fi +if test [-z $ICU_INCLUDES]; then + ICU_INCLUDES= +fi + +if test [-z $ICU_LIBS]; then + ICU_LIBS= +fi + +AC_CHECK_HEADERS([unicode/utypes.h], + [], + [echo "You must install ICU."; exit 1]) + if test [$WORKING_VERSION = "1"]; then VERSION="$VERSION + `git log -1 --format="%H" || echo ?`" fi @@ -152,6 +164,8 @@ Ur/Web configuration: Postgres C header: PGHEADER $PGHEADER MySQL C header: MSHEADER $MSHEADER SQLite C header: SQHEADER $SQHEADER + ICU includes: ICU_INCLUDES $ICU_INCLUDES + ICU libs: ICU_LIBS $ICU_LIBS OpenSSL: OPENSSL_LIBS $OPENSSL_LIBS pthreads: PTHREAD_CFLAGS $PTHREAD_CFLAGS PTHREAD_LIBS $PTHREAD_LIBS -- cgit v1.2.3 From fdd3695f9d4f754417da10018b260006e69b0e34 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Wed, 19 Dec 2018 11:08:44 -0500 Subject: Follow-up to #146: configure tests if ICU is available (now using ICU_INCLUDES to search for header) --- configure.ac | 2 ++ 1 file changed, 2 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7e069d0f..31bec477 100644 --- a/configure.ac +++ b/configure.ac @@ -95,6 +95,8 @@ if test [-z $ICU_INCLUDES]; then ICU_INCLUDES= fi +CPPFLAGS=$ICU_INCLUDES$CPPFLAGS + if test [-z $ICU_LIBS]; then ICU_LIBS= fi -- cgit v1.2.3 From f161387682d917484fb3c423adfe9b6ecc376d4d Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 17 Feb 2019 09:26:05 -0500 Subject: New release --- CHANGELOG | 15 +++++++++++++++ configure.ac | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/CHANGELOG b/CHANGELOG index 4e1c1c9e..dc8967db 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,18 @@ +======== +20190217 +======== + +- Update of standard-library string functions to handle non-ASCII UTF-8 properly +- New command-line options: -endpoints +- New .urp directive: safeGetDefault +- New Basis functions: textOfBlob, unsafeSerialized[To|From]String +- New Top functions: mapX4, foldR4 +- New List functions: allM, assocAddSorted, mapConcat, mapConcatM, mapMi, searchM +- New ListPair functions: mapM, unzip +- New Option function: mapM +- Flycheck integration +- Bug fixes and improvements to type inference, documentation, error messages, and compatibility + ======== 20180616 ======== diff --git a/configure.ac b/configure.ac index 31bec477..1c738051 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ -AC_INIT([urweb], [20180616]) -WORKING_VERSION=1 +AC_INIT([urweb], [20190217]) +WORKING_VERSION=0 AC_USE_SYSTEM_EXTENSIONS # automake 1.12 requires this, but automake 1.11 doesn't recognize it -- cgit v1.2.3 From 8d9905595994c5baac40561c862c53849bf1efe9 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 17 Feb 2019 10:02:38 -0500 Subject: Return to working version mode --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 1c738051..1c2e1d3d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([urweb], [20190217]) -WORKING_VERSION=0 +WORKING_VERSION=1 AC_USE_SYSTEM_EXTENSIONS # automake 1.12 requires this, but automake 1.11 doesn't recognize it -- cgit v1.2.3 From 1d4a9ff4a9e1cc72573df088e3be35b718c461b9 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 9 Feb 2020 09:45:36 -0500 Subject: New release --- CHANGELOG | 17 +++++++++++++++++ configure.ac | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/CHANGELOG b/CHANGELOG index dc8967db..d36431a5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,20 @@ +======== +20200209 +======== + +- New invocation mode 'urweb daemon restart' +- Disallow wildcards in signatures +- At compile time, start allowing "#" as a URL +- New option '-u' for generated HTTP servers, to use UNIX sockets +- New HTML tag attribute: 'step' (for ) +- New SQL function: 'similar' (via pg_trgm) +- New List function: foldli +- New Json functions: json_record_withOptional, json_time, rfc3339_in, rfc3339_out +- New Datetime member: ord_month +- New JavaScript FFI function 'listen' +- Experimental support for the Language Server Protocol (helpful for IDEs) +- Bug fixes and improvements to documentation, error messages, performance, and compatibility + ======== 20190217 ======== diff --git a/configure.ac b/configure.ac index 1c2e1d3d..1bd7fd3b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ -AC_INIT([urweb], [20190217]) -WORKING_VERSION=1 +AC_INIT([urweb], [20200209]) +WORKING_VERSION=0 AC_USE_SYSTEM_EXTENSIONS # automake 1.12 requires this, but automake 1.11 doesn't recognize it -- cgit v1.2.3