|
|
@ -2,7 +2,7 @@ |
|
|
|
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
|
|
# |
|
|
|
# Filename: package/.../cgit/fastcgi.diff |
|
|
|
# Copyright (C) 2009 The OpenSDE Project |
|
|
|
# Copyright (C) 2009 - 2010 The OpenSDE Project |
|
|
|
# |
|
|
|
# More information can be found in the files COPYING and README. |
|
|
|
# |
|
|
@ -41,14 +41,14 @@ stolen from http://www.docunext.com/wiki/Cgit |
|
|
|
#include <sys/stat.h> |
|
|
|
#include <fcntl.h> |
|
|
|
#include <stddef.h> |
|
|
|
--- ./Makefile.orig 2009-03-05 22:36:24.000000000 +0200
|
|
|
|
+++ ./Makefile 2009-03-05 22:36:39.000000000 +0200
|
|
|
|
@@ -68,7 +68,7 @@
|
|
|
|
--- ./Makefile.orig 2010-09-01 12:32:57.000000000 +0000
|
|
|
|
+++ ./Makefile 2010-09-09 13:34:31.000000000 +0000
|
|
|
|
@@ -71,7 +71,7 @@
|
|
|
|
$(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< |
|
|
|
|
|
|
|
|
|
|
|
-EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto
|
|
|
|
+EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lcrypto -lfcgi
|
|
|
|
-EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lpthread
|
|
|
|
+EXTLIBS = git/libgit.a git/xdiff/lib.a -lz -lpthread -lfcgi
|
|
|
|
OBJECTS = |
|
|
|
OBJECTS += cache.o |
|
|
|
OBJECTS += cgit.o |
|
|
@ -92,9 +92,9 @@ stolen from http://www.docunext.com/wiki/Cgit |
|
|
|
cache_fill_fn fn, void *cbdata); |
|
|
|
|
|
|
|
|
|
|
|
--- ./cgit.c.orig 2009-03-05 22:49:34.000000000 +0200
|
|
|
|
+++ ./cgit.c 2009-03-05 22:53:58.000000000 +0200
|
|
|
|
@@ -6,6 +6,7 @@
|
|
|
|
--- ./cgit.c.orig 2010-09-01 12:32:57.000000000 +0000
|
|
|
|
+++ ./cgit.c 2010-09-09 14:28:04.000000000 +0000
|
|
|
|
@@ -7,6 +7,7 @@
|
|
|
|
* (see COPYING for full license text) |
|
|
|
*/ |
|
|
|
|
|
|
@ -102,43 +102,40 @@ stolen from http://www.docunext.com/wiki/Cgit |
|
|
|
#include "cgit.h" |
|
|
|
#include "cache.h" |
|
|
|
#include "cmd.h" |
|
|
|
@@ -426,13 +427,15 @@
|
|
|
|
@@ -720,12 +721,13 @@
|
|
|
|
return ctx.cfg.cache_repo_ttl; |
|
|
|
} |
|
|
|
|
|
|
|
-int main(int argc, const char **argv)
|
|
|
|
+int main(int argc, char **argv)
|
|
|
|
{ |
|
|
|
- const char *cgit_config_env = getenv("CGIT_CONFIG");
|
|
|
|
- const char *path;
|
|
|
|
+ char *path;
|
|
|
|
char *qry; |
|
|
|
- int err, ttl;
|
|
|
|
|
|
|
|
+ while (FCGI_Accept() >= 0) {
|
|
|
|
+ const char *cgit_config_env = getenv("CGIT_CONFIG");
|
|
|
|
+ int err, ttl;
|
|
|
|
+
|
|
|
|
prepare_context(&ctx); |
|
|
|
cgit_repolist.length = 0; |
|
|
|
cgit_repolist.count = 0; |
|
|
|
@@ -460,7 +463,6 @@
|
|
|
|
@@ -748,7 +750,6 @@
|
|
|
|
* long as PATH_INFO is included in the cache lookup key). |
|
|
|
*/ |
|
|
|
path = getenv("PATH_INFO"); |
|
|
|
path = ctx.env.path_info; |
|
|
|
- if (!ctx.qry.url && path) {
|
|
|
|
if (path[0] == '/') |
|
|
|
path++; |
|
|
|
ctx.qry.url = xstrdup(path); |
|
|
|
@@ -471,7 +473,6 @@
|
|
|
|
@@ -759,7 +760,6 @@
|
|
|
|
} else |
|
|
|
ctx.qry.raw = ctx.qry.url; |
|
|
|
ctx.qry.raw = xstrdup(ctx.qry.url); |
|
|
|
cgit_parse_url(ctx.qry.url); |
|
|
|
- }
|
|
|
|
|
|
|
|
ttl = calc_ttl(); |
|
|
|
ctx.page.expires += ttl*60; |
|
|
|
@@ -482,5 +483,6 @@
|
|
|
|
@@ -772,5 +772,6 @@
|
|
|
|
if (err) |
|
|
|
cgit_print_error(fmt("Error processing page: %s (%d)", |
|
|
|
strerror(err), err)); |
|
|
|