Skip to content

Commit

Permalink
Merge branch 'release/v1.13.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jasom committed Dec 25, 2021
2 parents 36055bf + 18384d2 commit b16fba3
Show file tree
Hide file tree
Showing 56 changed files with 709 additions and 233 deletions.
14 changes: 10 additions & 4 deletions Makefile
Expand Up @@ -7,20 +7,22 @@ PREFIX?=/usr/local
get_objs = $(addsuffix .o,$(basename $(wildcard $(1))))

ASM=$(wildcard src/**/*.S src/*.S)
RAGEL_TARGETS=src/state.c src/http11/http11_parser.c
RAGEL_TARGETS=src/state.c src/http11/http11_parser.c src/handler_parser.c src/http11/httpclient_parser.c
RAGEL_OBJECTS=$(patsubst %.c,%.o,${RAGEL_TARGETS})
SOURCES=$(wildcard src/**/*.c src/*.c) $(RAGEL_TARGETS)
OBJECTS=$(patsubst %.c,%.o,${SOURCES}) $(patsubst %.S,%.o,${ASM})
OBJECTS_NOEXT=$(filter-out ${OBJECTS_EXTERNAL},${OBJECTS})
LIB_SRC=$(filter-out src/mongrel2.c,${SOURCES})
LIB_OBJ=$(filter-out src/mongrel2.o,${OBJECTS})
TEST_SRC=$(wildcard tests/*_tests.c)
TESTS=$(patsubst %.c,%,${TEST_SRC})
MAKEOPTS=OPTFLAGS="${CFLAGS} ${NOEXTCFLAGS} ${OPTFLAGS}" LIBS="${LIBS}" DESTDIR="${DESTDIR}" PREFIX="${PREFIX}"
MAKEOPTS=OPTFLAGS="${CFLAGS} ${NOEXTCFLAGS} ${OPTFLAGS}" LDFLAGS="${LDFLAGS}" LIBS="${LIBS}" DESTDIR="${DESTDIR}" PREFIX="${PREFIX}"

all: bin/mongrel2 tests m2sh procer

${OBJECTS_NOEXT}: CFLAGS += ${NOEXTCFLAGS}
${OBJECTS}: | builddirs
$(RAGEL_OBJECTS): CFLAGS += -Wno-unused-const-variable -Wimplicit-fallthrough=0

.PHONY: builddirs
builddirs:
Expand Down Expand Up @@ -72,7 +74,7 @@ tests/config.sqlite: src/config/config.sql src/config/example.sql src/config/mim
sqlite3 $@ < src/config/mimetypes.sql

$(TESTS): %: %.c build/libm2.a
$(CC) $(CFLAGS) -o $@ $< build/libm2.a $(LIBS)
$(CC) $(CFLAGS) -o $@ $< build/libm2.a $(LDFLAGS) $(LIBS)

src/state.c: src/state.rl src/state_machine.rl
src/http11/http11_parser.c: src/http11/http11_parser.rl
Expand Down Expand Up @@ -163,17 +165,19 @@ release: tarball
netbsd: OPTFLAGS += -I/usr/local/include -I/usr/pkg/include
netbsd: LDFLAGS += -L/usr/local/lib -L/usr/pkg/lib
netbsd: LIBS=-lzmq -lsqlite3 $(LDFLAGS)
netbsd: CFLAGS += -DHAS_ARC4RANDOM
netbsd: dev


freebsd: OPTFLAGS += -I/usr/local/include
freebsd: LDFLAGS += -L/usr/local/lib -pthread
freebsd: LIBS=-lzmq -lsqlite3 $(LDFLAGS)
freebsd: CFLAGS += -DHAS_ARC4RANDOM
freebsd: all

openbsd: OPTFLAGS += -I/usr/local/include
openbsd: LDFLAGS += -L/usr/local/lib -pthread
openbsd: LIBS=-lzmq -lsqlite3 $(LDFLAGS)
openbsd: CFLAGS += -DHAS_ARC4RANDOM
openbsd: all

solaris: OPTFLAGS += -I/usr/local/include
Expand All @@ -184,8 +188,10 @@ solaris: all

macports: OPTFLAGS += -I/opt/local/include
macports: LDFLAGS += -L/opt/local/lib -undefined dynamic_lookup
macports: CFLAGS += -DHAS_ARC4RANDOM
macports: all

brew: OPTFLAGS += -I/usr/local/include
brew: LDFLAGS += -L/usr/local/lib -undefined dynamic_lookup
brew: CFLAGS += -DHAS_ARC4RANDOM
brew: all
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -32,9 +32,9 @@ Features
Download
--------

mongrel2 is now v1.12.2 as of *Fri Jun 14 2019*:
mongrel2 is now v1.13.0 as of *Fri Dec 24 2021*:

* [mongrel2-v1.12.2.tar.bz2](https://github.com/mongrel2/mongrel2/releases/download/v1.12.2/mongrel2-v1.12.2.tar.bz2)
* [mongrel2-v1.13.0.tar.bz2](https://github.com/mongrel2/mongrel2/releases/v1.13.0/download/mongrel2-v1.13.0.tar.bz2)

Documentation
-------------
Expand Down
70 changes: 70 additions & 0 deletions changelog.txt
@@ -1,3 +1,73 @@
Changes from 1.12.2 to 1.13.0
-----------------------------

* Fix helptext messages
4be4a861

* Changes to compile with gcc10
ebee2d99

* Changes to fix builds on BSDs
c8af3538
c8ba8cf0

* Make HAVEGE dependency optional
8a6db3be
00af3d3c

* Website updates
786ac316

* Python 3 support
df257a04

* Prevent spurious leave notifications
677ffcf2

* Fix crash in websocket support
945434ca
6c458d53

* Address some warnings
eb95f7c4
72520957
71845ced
0a4e763a
1cb046a7
d68fb292
6943899e
f11270e1
8860740e
a1876145

* M2SH: check for proper exit when running system() commands
7cc5b15e

* Fix possible use of uninitialized variable
6c57fb63

* Logging improvements (better consistency, runtime filtering)
300b7fa8
5c5fd46a
cd8bce0a
c28a0f08
274b1dd9

Changes from 1.12.1 to 1.12.2
-----------------------------

* Disable some warnings that were spurious for ragel-generated files
fd3c6e6b

* Fix bug in previous bugfix for incorrect content-length
67db18df

Changes from 1.12.0 to 1.12.1
-----------------------------

* Fix to prevent crashing on large files
66caedbb

Changes from 1.11.0 to 1.12.0
-----------------------------

Expand Down
7 changes: 6 additions & 1 deletion docs/site/gensite.lua
@@ -1,6 +1,11 @@
require 'model.site'

local input = assert(Tir.load_file("./", "config.json"))
json = require 'dkjson'
Tir = { }
Tir.load_file = load_file
Tir.view = view

local input = assert(load_file("./", "config.json"))
local config = assert(json.decode(input))

Generator:run(config.contents)
Expand Down
18 changes: 13 additions & 5 deletions docs/site/model/site.lua
@@ -1,7 +1,7 @@
local tir = require 'tir.view'
local markdown = require 'markdown'
local posix = require 'posix'
local json = require 'json'
local json = require 'dkjson'
local util = require 'tir.util'

local RFC_822 = "%a, %d %b %Y %H:%M:%S %z"
Expand All @@ -24,15 +24,23 @@ function Generator:extract_target_name(template, in_name)
end

function Generator:load_template(data, in_name)
local newData = assert(json.decode(assert(Tir.load_file('./',self.global_data))))
local newData = assert(json.decode(assert(load_file('./',self.global_data))))
for k,v in pairs(newData) do data[k] = v end
local template = Tir.view(data.template)
local template = view(data.template)
return template, self:extract_target_name(data.template, in_name)
end


function Generator:load_data(in_name)
local input = assert(Tir.load_file(self.source, in_name))
local input = assert(load_file(self.source, in_name))
--[[
print("INPUT")
print(input)
print("----")
print("OUTPUT")
print(json.decode(input))
print("----")
]]--
local data = assert(json.decode(input))
return data
end
Expand Down Expand Up @@ -119,7 +127,7 @@ function Generator:render_contents(data, source, output)

for _, path in ipairs(mdfiles) do
local target = path:gsub(base_strip, "")
local content = Tir.load_file(self.source, target)
local content = load_file(self.source, target)
data.contents = markdown(content)
local out_name = nil

Expand Down
2 changes: 1 addition & 1 deletion docs/site/src/downloads/index.json
@@ -1,5 +1,5 @@
{
'template': 'downloads.html',
"template": "downloads.html",
"top": { "prev": "Home", "cur": "Downloads" },

"releases": [
Expand Down
2 changes: 1 addition & 1 deletion docs/site/src/features/index.json
@@ -1,5 +1,5 @@
{
'template': 'features.html',
"template": "features.html",
"contents": {
"root": { "link": "/features/", "name": "Features" },
"template": "features-post.html",
Expand Down
5 changes: 3 additions & 2 deletions docs/site/src/features/languages.md
Expand Up @@ -23,8 +23,9 @@ list of currently supported languages and platforms, in alphabetical order:
* PHP: <a href="http://github.com/winks/m2php">m2php</a>
* Perl: <a href="http://github.com/lestrrat/Plack-Handler-Mongrel2">Plack-Handler-Mongrel2</a> and <a href="https://github.com/jrockway/anyevent-mongrel2/">AnyEvent-Mongrel2</a>
* Python: <a href="http://wsgid.com">wsgid</a> and <a href="http://github.com/berry/Mongrel2-WSGI-Handler">Mongrel2-WSGI-Handler (old?)</a>
* Ruby: <a href="http://github.com/perplexes/m2r">m2r</a> and <a href="http://github.com/darkhelmet/rack-mongrel2">rack-mongrel2</a>
* Ruby: <a href="http://github.com/perplexes/m2r">m2r</a> and <a href="http://github.com/darkhelmet/rack-mongrel2">rack-mongrel2</a>
* Node.js: <a href="https://github.com/dan-manges/m2node">m2node</a>.
* Nim: <a href="nim-mongrel2">nim-mongrel2</a>


Frameworks
Expand All @@ -37,10 +38,10 @@ don't require any middleware and take advantage of Mongrel2 new
protocol features:

* <a href="http://tir.mongrel2.org/">Tir</a> is a Lua framework written to show how to do direct frameworks with Mongrel2.
* <a href="https://rubygems.org/gems/strelka/">Strelka</a> is a full-featured Ruby framework.
* <a href="http://github.com/j2labs/brubeck">Brubeck</a> is an asynchronous, non-blocking web framework written in Python.
* <a href="https://github.com/daogangtang/bamboo">Bamboo</a> is a Tir derivative with a bunch more features.
* <a href="http://www.photon-project.com">Photon</a> is a PHP framework similar to Tir and *way* faster than PHP.

<p>It is very easy to create a handler, you should read the <a href="http://mongrel2.org/manual/book-final.html">manual about handlers</a> for
information on writing one for your language.</p>

Expand Down
2 changes: 1 addition & 1 deletion docs/site/src/index.json
@@ -1,3 +1,3 @@
{
'template': 'index.html',
"template": "index.html",
}

0 comments on commit b16fba3

Please sign in to comment.