|
diff --git a/cgit.c b/cgit.c index ac882c3..0deae12 100644 --- a/ cgit.c+++ b/ cgit.c |
|
@@ -135,24 +135,26 @@ static void querystring_cb(const char *name, const char *value) |
135 | } else if (!strcmp(name, "id")) { |
135 | } else if (!strcmp(name, "id")) { |
136 | ctx.qry.sha1 = xstrdup(value); |
136 | ctx.qry.sha1 = xstrdup(value); |
137 | ctx.qry.has_sha1 = 1; |
137 | ctx.qry.has_sha1 = 1; |
138 | } else if (!strcmp(name, "id2")) { |
138 | } else if (!strcmp(name, "id2")) { |
139 | ctx.qry.sha2 = xstrdup(value); |
139 | ctx.qry.sha2 = xstrdup(value); |
140 | ctx.qry.has_sha1 = 1; |
140 | ctx.qry.has_sha1 = 1; |
141 | } else if (!strcmp(name, "ofs")) { |
141 | } else if (!strcmp(name, "ofs")) { |
142 | ctx.qry.ofs = atoi(value); |
142 | ctx.qry.ofs = atoi(value); |
143 | } else if (!strcmp(name, "path")) { |
143 | } else if (!strcmp(name, "path")) { |
144 | ctx.qry.path = trim_end(value, '/'); |
144 | ctx.qry.path = trim_end(value, '/'); |
145 | } else if (!strcmp(name, "name")) { |
145 | } else if (!strcmp(name, "name")) { |
146 | ctx.qry.name = xstrdup(value); |
146 | ctx.qry.name = xstrdup(value); |
| |
147 | } else if (!strcmp(name, "mimetype")) { |
| |
148 | ctx.qry.mimetype = xstrdup(value); |
147 | } |
149 | } |
148 | } |
150 | } |
149 | |
151 | |
150 | static void prepare_context(struct cgit_context *ctx) |
152 | static void prepare_context(struct cgit_context *ctx) |
151 | { |
153 | { |
152 | memset(ctx, 0, sizeof(ctx)); |
154 | memset(ctx, 0, sizeof(ctx)); |
153 | ctx->cfg.agefile = "info/web/last-modified"; |
155 | ctx->cfg.agefile = "info/web/last-modified"; |
154 | ctx->cfg.nocache = 0; |
156 | ctx->cfg.nocache = 0; |
155 | ctx->cfg.cache_size = 0; |
157 | ctx->cfg.cache_size = 0; |
156 | ctx->cfg.cache_dynamic_ttl = 5; |
158 | ctx->cfg.cache_dynamic_ttl = 5; |
157 | ctx->cfg.cache_max_create_time = 5; |
159 | ctx->cfg.cache_max_create_time = 5; |
158 | ctx->cfg.cache_repo_ttl = 5; |
160 | ctx->cfg.cache_repo_ttl = 5; |
|