commit - 76a9a38e0c199dfd2ee26f23792b56e2b77952c2
commit + 5d6193d0d085d8d8ab3c2f6357b3121bbe728a50
blob - 58518b3acbe68a45a2d45866c315ef15fa7b8a40
blob + e3dca64b089f1e1e0d76ef5826837a9f3b31cf50
--- gotwebd/gotweb.c
+++ gotwebd/gotweb.c
{ "headref", HEADREF },
{ "index_page", INDEX_PAGE },
{ "path", PATH },
- { "page", PAGE },
};
static const struct action_keys action_keys[] = {
if (binary) {
struct gotweb_url url = {
.index_page = -1,
- .page = -1,
.action = BLOBRAW,
.path = qs->path,
.commit = qs->commit,
goto done;
}
break;
- case PAGE:
- if (*value == '\0')
- break;
- (*qs)->page = strtonum(value, INT64_MIN,
- INT64_MAX, &errstr);
- if (errstr) {
- error = got_error_from_errno3(__func__,
- "strtonum", errstr);
- goto done;
- }
- if ((*qs)->page < 0)
- (*qs)->page = 0;
- break;
}
/* entry found */
*prev = (struct gotweb_url){
.action = -1,
.index_page = qs->index_page - 1,
- .page = -1,
};
}
if (t->next_disp == srv->max_repos_display &&
*next = (struct gotweb_url){
.action = -1,
.index_page = qs->index_page + 1,
- .page = -1,
};
}
}
sep = "&";
}
- if (url->page != -1) {
- if (tp_writef(c->tp, "%spage=%d", sep, url->page) == -1)
- return -1;
- sep = "&";
- }
-
return 0;
}
blob - 10e6fc3016b6d24b44b9fc556d0509f124f4c761
blob + 23dfd5628aac5e91500730e48a91ab1fb553f397
--- gotwebd/gotwebd.h
+++ gotwebd/gotwebd.h
struct gotweb_url {
int action;
int index_page;
- int page;
const char *commit;
const char *previd;
const char *prevset;
char *headref;
int index_page;
char *path;
- int page;
};
struct querystring_keys {
HEADREF,
INDEX_PAGE,
PATH,
- PAGE,
};
enum query_actions {
blob - ae9add1ced0efa1b69df5c648929ad89710387a4
blob + 7f69ce9024e9a57fbdd1f4b1b3aa6f64dacb8aae
--- gotwebd/pages.tmpl
+++ gotwebd/pages.tmpl
memset(&url, 0, sizeof(url));
url.index_page = -1;
- url.page = -1;
url.action = TREE;
url.path = qs->path;
url.commit = qs->commit;
memset(&u_path, 0, sizeof(u_path));
u_path.index_page = -1;
- u_path.page = -1;
u_path.action = SUMMARY;
!}
<!doctype html>
struct gotweb_url summary = {
.action = SUMMARY,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
}, briefs = {
.action = BRIEFS,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
}, commits = {
.action = COMMITS,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
}, tags = {
.action = TAGS,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
}, tree = {
.action = TREE,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
}, rss = {
.action = RSS,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
};
!}
diff_url = (struct gotweb_url){
.action = DIFF,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.headref = qs->headref,
};
patch_url = (struct gotweb_url){
.action = PATCH,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.headref = qs->headref,
};
tree_url = (struct gotweb_url){
.action = TREE,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.headref = qs->headref,
};
diff = (struct gotweb_url){
.action = DIFF,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
};
patch = (struct gotweb_url){
.action = PATCH,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
};
tree = (struct gotweb_url){
.action = TREE,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
};
!}
memset(&briefs_url, 0, sizeof(briefs_url));
briefs_url.index_page = -1,
- briefs_url.page = -1,
briefs_url.action = BRIEFS,
briefs_url.path = qs->path,
briefs_url.commit = qs->commit,
memset(&url, 0, sizeof(url));
url.index_page = -1;
- url.page = -1;
url.action = BLOB;
url.path = t->qs->path;
url.file = readme;
mode_t mode;
struct gotweb_url url = {
.index_page = -1,
- .page = -1,
.commit = rc->commit_id,
.path = qs->path,
};
struct gotweb_url url = {
.action = TAG,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.commit = rt->commit_id,
};
struct gotweb_url patch_url, tree_url = {
.action = TREE,
.index_page = -1,
- .page = -1,
.path = qs->path,
.commit = rc->commit_id,
};
struct gotweb_url url = {
.action = SUMMARY,
.index_page = -1,
- .page = -1,
.path = qs->path,
};
memset(&briefs_url, 0, sizeof(briefs_url));
briefs_url.index_page = -1,
- briefs_url.page = -1,
briefs_url.action = BRIEFS,
briefs_url.path = qs->path,
briefs_url.commit = qs->commit,
struct gotweb_url url = {
.action = DIFF,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.commit = bline->id_str,
};
struct gotweb_url summary = {
.action = SUMMARY,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
};
!}
struct gotweb_url tag = {
.action = TAG,
.index_page = -1,
- .page = -1,
.path = repo_dir->name,
.commit = rt->commit_id,
};