]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.c
"max-blob-size" config var to limit generated HTML size
[ps-cgit] / cgit.c
diff --git a/cgit.c b/cgit.c
index a17f40d5abfb14c434dbae8811ed839b89bc555e..e1d38c2668c160b667f4d908006ae96a72a68394 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -165,6 +165,8 @@ void config_cb(const char *name, const char *value)
                ctx.cfg.max_msg_len = atoi(value);
        else if (!strcmp(name, "max-repodesc-length"))
                ctx.cfg.max_repodesc_len = atoi(value);
+       else if (!strcmp(name, "max-blob-size"))
+               ctx.cfg.max_blob_size = atoi(value);
        else if (!strcmp(name, "max-repo-count"))
                ctx.cfg.max_repo_count = atoi(value);
        else if (!strcmp(name, "max-commit-count"))
@@ -270,6 +272,7 @@ static void prepare_context(struct cgit_context *ctx)
        ctx->cfg.max_lock_attempts = 5;
        ctx->cfg.max_msg_len = 80;
        ctx->cfg.max_repodesc_len = 80;
+       ctx->cfg.max_blob_size = 0;
        ctx->cfg.max_stats = 0;
        ctx->cfg.module_link = "./?repo=%s&page=commit&id=%s";
        ctx->cfg.renamelimit = -1;