1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
|
This patch contains the differences between the upstream tarball and
the sources actually used for building the package.
Option single-debian-patch is used as the changes are tracked in git.
--- mongrel2-1.12.2.orig/Makefile
+++ mongrel2-1.12.2/Makefile
@@ -1,19 +1,19 @@
CFLAGS?=-g -O2
-CFLAGS += -Wall -Wextra -Wno-implicit-fallthrough -Wno-unused-const-variable -I./src -DNDEBUG -D_FILE_OFFSET_BITS=64 -pthread
+CFLAGS += -Wall -Wextra -Wno-implicit-fallthrough -Wno-unused-const-variable -idirafter "src" -DNDEBUG -D_FILE_OFFSET_BITS=64 -pthread
CFLAGS += ${OPTFLAGS}
LIBS+=-lzmq -ldl -lsqlite3 -lmbedtls -lmbedx509 -lmbedcrypto
PREFIX?=/usr/local
-get_objs = $(addsuffix .o,$(basename $(wildcard $(1))))
+get_objs = $(addsuffix .o,$(basename $(sort $(wildcard $(1)))))
-ASM=$(wildcard src/**/*.S src/*.S)
+ASM=$(sort $(wildcard src/**/*.S src/*.S))
RAGEL_TARGETS=src/state.c src/http11/http11_parser.c
-SOURCES=$(wildcard src/**/*.c src/*.c) $(RAGEL_TARGETS)
+SOURCES=$(sort $(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)
+TEST_SRC=$(sort $(wildcard tests/*_tests.c))
TESTS=$(patsubst %.c,%,${TEST_SRC})
MAKEOPTS=OPTFLAGS="${CFLAGS} ${NOEXTCFLAGS} ${OPTFLAGS}" LIBS="${LIBS}" DESTDIR="${DESTDIR}" PREFIX="${PREFIX}"
@@ -41,6 +41,7 @@ clean:
rm -f tests/test.pid
rm -f tests/tests.log
rm -f tests/empty.sqlite
+ rm -f tests/request_payloads.txt
rm -f tools/lemon/lemon
rm -f tools/m2sh/tests/tests.log
rm -rf release-scripts/output
@@ -72,7 +73,7 @@ tests/config.sqlite: src/config/config.s
sqlite3 $@ < src/config/mimetypes.sql
$(TESTS): %: %.c build/libm2.a
- $(CC) $(CFLAGS) -o $@ $< build/libm2.a $(LIBS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< build/libm2.a $(LIBS)
src/state.c: src/state.rl src/state_machine.rl
src/http11/http11_parser.c: src/http11/http11_parser.rl
@@ -125,7 +126,7 @@ strace:
VALGRIND="strace" ${MAKE}
%.o: %.S
- $(CC) $(CFLAGS) -c $< -o $@
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
coverage: NOEXTCFLAGS += -fprofile-arcs -ftest-coverage
coverage: LIBS += -lgcov
--- mongrel2-1.12.2.orig/src/adt/radixmap.c
+++ mongrel2-1.12.2/src/adt/radixmap.c
@@ -6,13 +6,20 @@
#include <stdlib.h>
#include <assert.h>
#include <mem/halloc.h>
+#include <endian.h>
#include "adt/radixmap.h"
#include "dbg.h"
// undefine this to run the more correct but slower sort
#define FAST_OPS
+#if __BYTE_ORDER == __LITTLE_ENDIAN
#define ByteOf(x,y) (((uint8_t *)x)[(y)])
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define ByteOf(x,y) (((uint8_t *)x)[3-(y)])
+#else
+#error unknown byte order
+#endif
static inline void radix_sort(short offset, uint64_t N, uint64_t *source, uint64_t *dest)
{
--- mongrel2-1.12.2.orig/src/bsd_specific.c
+++ mongrel2-1.12.2/src/bsd_specific.c
@@ -45,7 +45,7 @@
/**
* BSD version of sendfile, which is OSX and FreeBSD mostly.
*/
-int bsd_sendfile(int out_fd, int in_fd, off_t *offset, size_t count) {
+int my_bsd_sendfile(int out_fd, int in_fd, off_t *offset, size_t count) {
off_t my_count = count;
int rc;
@@ -79,7 +79,7 @@ extern int fdsend(int fd, void *buf, int
/** For the BSDs without sendfile like open and net.**/
-int bsd_sendfile(int out_fd, int in_fd, off_t *offset, size_t count) {
+int my_bsd_sendfile(int out_fd, int in_fd, off_t *offset, size_t count) {
char buf[BSD_SENDFILE_BUF_SIZE];
int ret = -1;
off_t orig_offset = 0;
--- mongrel2-1.12.2.orig/src/connection.c
+++ mongrel2-1.12.2/src/connection.c
@@ -1234,7 +1234,7 @@ void Connection_task(void *v)
}
error: // fallthrough
- if(conn->handler) {
+ if(conn->deliverTaskStatus == DT_RUNNING) {
Connection_handler_notify_leave(conn);
}
@@ -1326,7 +1326,6 @@ void Connection_deliver_task(void *v)
msg.data=NULL;
}
error:
- conn->handler = NULL; // we're shutting down, don't notify anything else
conn->deliverTaskStatus=DT_DYING;
tns_value_destroy(msg.data);
while(!list_isempty(conn->deliverQueue)) {
--- mongrel2-1.12.2.orig/src/io.h
+++ mongrel2-1.12.2/src/io.h
@@ -105,7 +105,7 @@ int IOBuf_stream_file(IOBuf *buf, int fd
#define IOBuf_fd(I) ((I)->fd)
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
-#define IOBuf_sendfile bsd_sendfile
+#define IOBuf_sendfile my_bsd_sendfile
#else
#define IOBuf_sendfile sendfile
#endif
--- mongrel2-1.12.2.orig/src/unixy.h
+++ mongrel2-1.12.2/src/unixy.h
@@ -38,7 +38,7 @@
#include <bstring.h>
#include <unistd.h>
-char *m2program;
+extern char *m2program;
int Unixy_chroot(bstring path);
@@ -46,8 +46,6 @@ int Unixy_in_chroot();
int Unixy_drop_priv(bstring path);
-bstring Unixy_getcwd();
-
int Unixy_pid_file(bstring path);
int Unixy_daemonize(int dochdir);
--- mongrel2-1.12.2.orig/tests/filters/Makefile
+++ mongrel2-1.12.2/tests/filters/Makefile
@@ -1,12 +1,12 @@
PREFIX?=/usr/local
-CFLAGS=-I../../src -I../../src/mbedtls/include $(OPTFLAGS) -fPIC -shared -nostartfiles -L../../build
-LDFLAGS=$(OPTLIBS)
+CFLAGS+=-idirafter ../../src $(OPTFLAGS) -fPIC -shared -nostartfiles -L../../build
+LDFLAGS+=$(OPTLIBS)
all: test_filter.so test_filter_a.so test_filter_b.so test_filter_c.so
%.so : %.c ../../build/libm2.a
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< ../../build/libm2.a
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< ../../build/libm2.a
clean:
rm -f *.so
--- mongrel2-1.12.2.orig/tests/unixy_tests.c
+++ mongrel2-1.12.2/tests/unixy_tests.c
@@ -51,7 +51,9 @@ char * all_tests() {
mu_suite_start();
if(getuid() != 0) {
+#ifndef __gnu_hurd__
mu_run_test(test_Unixy_chroot_fails);
+#endif
mu_run_test(test_Unixy_drop_priv_fails);
}
mu_run_test(test_Unixy_pid_file);
--- mongrel2-1.12.2.orig/tools/config_modules/Makefile
+++ mongrel2-1.12.2/tools/config_modules/Makefile
@@ -1,6 +1,6 @@
PREFIX?=/usr/local
-CFLAGS=-I../../src -I../../src/mbedtls/include $(OPTFLAGS) -fPIC -shared -nostartfiles -L../../build
-LDFLAGS=$(OPTLIBS)
+CFLAGS+=-idirafter ../../src $(OPTFLAGS) -fPIC -shared -nostartfiles -L../../build
+LDFLAGS+=$(OPTLIBS)
MONGO_SRC = mongo-c-driver/src/bson.c \
mongo-c-driver/src/encoding.c \
@@ -22,11 +22,11 @@ fetch_mongo_c_driver:
mongodb.so: CFLAGS += $(MONGO_CFLAGS)
mongodb.so: fetch_mongo_c_driver
mongodb.so: mongodb.c
- $(CC) $(CFLAGS) -c $(MONGO_SRC)
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c $(MONGO_SRC)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< bson.o encoding.o gridfs.o md5.o mongo.o env_posix.o numbers.o ../../build/libm2.a
%.so : %.c
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< ../../build/libm2.a
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< ../../build/libm2.a
clean:
rm -f *.o *.so
--- mongrel2-1.12.2.orig/tools/filters/Makefile
+++ mongrel2-1.12.2/tools/filters/Makefile
@@ -1,12 +1,12 @@
PREFIX?=/usr/local
-CFLAGS=-I../../src -I../../src/mbedtls/include $(OPTFLAGS) -g -fPIC -shared -nostartfiles -L../../build
-LDFLAGS=$(OPTLIBS)
+CFLAGS+=-idirafter ../../src $(OPTFLAGS) -g -fPIC -shared -nostartfiles -L../../build
+LDFLAGS+=$(OPTLIBS)
all: null.so rewrite.so sendfile.so
%.so : %.c
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< ../../build/libm2.a
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared -o $@ $< ../../build/libm2.a
clean:
rm -f *.so
--- mongrel2-1.12.2.orig/tools/m2sh/Makefile
+++ mongrel2-1.12.2/tools/m2sh/Makefile
@@ -1,10 +1,10 @@
-CFLAGS=-DNDEBUG -DNO_LINENOS -pthread -g -I../../src -Isrc -Wall $(OPTFLAGS)
+CFLAGS+=-DNDEBUG -DNO_LINENOS -pthread -g -I../../src -Isrc -Wall $(OPTFLAGS)
LIBS=-lzmq -lsqlite3 ../../build/libm2.a $(OPTLIBS)
PREFIX?=/usr/local
-SOURCES=$(wildcard src/*.c src/**/*.c)
+SOURCES=$(sort $(wildcard src/*.c src/**/*.c))
OBJECTS=$(patsubst %.c,%.o,${SOURCES})
-TEST_SRC=$(wildcard tests/*.c)
+TEST_SRC=$(sort $(wildcard tests/*.c))
TESTS=$(patsubst %.c,%,${TEST_SRC})
LIB_SRC=$(filter-out src/m2sh.c,${SOURCES})
LIB_OBJ=$(filter-out src/m2sh.o,${OBJECTS})
@@ -24,10 +24,10 @@ build/libm2sh.a: ${LIB_OBJ}
build/m2sh: ../lemon/lemon ../../build/libm2.a ${OBJECTS}
mkdir -p build
- $(CC) $(CFLAGS) -o build/m2sh ${OBJECTS} ../../build/libm2.a $(LIBS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o build/m2sh ${OBJECTS} ../../build/libm2.a $(LIBS)
../lemon/lemon: ../lemon/lemon.c
- $(CC) -O2 ../lemon/lemon.c -o ../lemon/lemon
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) ../lemon/lemon.c -o ../lemon/lemon
tests: build/libm2sh.a ${TESTS}
sh ./tests/runtests.sh
@@ -39,7 +39,7 @@ tests: build/libm2sh.a ${TESTS}
ragel -G2 $<
$(TESTS): %: %.c build/libm2sh.a
- $(CC) $(CFLAGS) -o $@ $< build/libm2sh.a ../../build/libm2.a $(LIBS)
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< build/libm2sh.a ../../build/libm2.a $(LIBS)
../../build/libm2.a:
cd ../.. && make clean all
--- mongrel2-1.12.2.orig/tools/procer/Makefile
+++ mongrel2-1.12.2/tools/procer/Makefile
@@ -1,14 +1,14 @@
-CFLAGS=-DNDEBUG -pthread -g -I../../src -Wall $(OPTFLAGS)
+CFLAGS+=-DNDEBUG -pthread -g -I../../src -Wall $(OPTFLAGS)
PREFIX?=/usr/local
LIBS?=-lzmq
-SOURCES=$(wildcard *.c)
+SOURCES=$(sort $(wildcard *.c))
OBJECTS=$(patsubst %.c,%.o,${SOURCES})
all: procer
procer: ../../build/libm2.a ${OBJECTS}
- $(CC) $(OPTFLAGS) $(OPTLIBS) -o $@ ${OBJECTS} ../../build/libm2.a ${LIBS}
+ $(CC) $(LDFLAGS) $(OPTFLAGS) $(OPTLIBS) -o $@ ${OBJECTS} ../../build/libm2.a ${LIBS}
clean:
rm -f *.o procer
|