AgeCommit message (Collapse)AuthorLines
Let go of a slot lock that cannot take its keyBryce Kwon-0/+3
A failed truncate or key write returned with the descriptor still open, so the lock was held while the page rendered uncached and the file was left behind. It is removed before its last close, as every holder does.
Keep lock contention out of the error logBryce Kwon-11/+25
process_slot logged every failure to lock, so each request that found its slot being filled left a line, while refresh_slot logged none, so an expired slot in a directory the server cannot write was served stale for good without a word. lock_slot now logs the step that failed, as the scan does, and leaves out only another request at work.
Lock the cached repolist with flockBryce Kwon-9/+4
The slot lock has to be an flock, since an exec filter drops a record lock when it closes the stdout a fill writes through. The scan only got by with fcntl because nothing reopens its file while it runs. One kind of lock lets the two share their code, and on Linux, where the kinds never see each other, an flock on the scan's file now holds a scan off like any other.
Open the lock files close-on-execBryce Kwon-2/+4
Each exec filter and snapshot compressor a fill runs inherited the slot's lock descriptor beside the stdout it writes into. An flock lasts until its last copy closes and nothing waits for a process a filter leaves behind, so a fill killed before its rename could leave the slot locked, and served stale or uncached, for as long as such a process lived. The scan holds its lock across no exec and opens the same way so that the two stay alike.
Declare the repository variables' struct in placeBryce Kwon-6/+4
Build cgit_ensure_end's copy in one expressionBryce Kwon-9/+1
Leave the zeroed repository fields to the memsetBryce Kwon-3/+0
Grow the repository and ref lists with ALLOC_GROWBryce Kwon-24/+6
Join a diff line's pieces within one callBryce Kwon-32/+8
Xdiff hands out_line a whole line each time, as the prefix, the record and any no-newline marker, and the fragment was already flushed before the call returned, so nothing ever carried over to the next call.
Cut two comments that repeat the header or a nameBryce Kwon-5/+3
Explain the encoded ampersand and plus at the tableBryce Kwon-6/+5
Map the markup characters to entities in one placeBryce Kwon-28/+34
Keep the permission triplet beside its one callerBryce Kwon-13/+8
Keep the clone row and title docs in the headerBryce Kwon-11/+15
Keep three helpers beside their only callersBryce Kwon-62/+62
Build cgit_date_mode's result on the stackBryce Kwon-2/+1
Write the meta description in one placeBryce Kwon-6/+4
Read a title's path from the end with strrchrBryce Kwon-20/+7
Trim trailing slashes with git's strbuf helperBryce Kwon-12/+4
Build the full current url from the current urlBryce Kwon-8/+3
Fold the va_list error page into its one callerBryce Kwon-13/+4
Ask head_is_named before carrying the branchBryce Kwon-1/+1
Let self_link's fallback be a plain reporevlinkBryce Kwon-8/+2
Escape a submodule link's class like the othersBryce Kwon-6/+6
Open site and repository links through one helperBryce Kwon-24/+17
Write each query argument through one helperBryce Kwon-49/+30
Return repolink's delimiter without copying itBryce Kwon-1/+1
Drop the query-string form of every linkBryce Kwon-86/+31
cgit falls back to SCRIPT_NAME for virtual_root whenever cgitrc leaves it out, so the ?url= and ?r= forms only ever reached an error page raised while cgitrc was still being read. The page argument of cgit_add_hidden_formfields fed only the url field, so it is unused until its callers stop passing it.
Stop leaking the host on an embedded pageBryce Kwon-3/+3
Stop leaking the short hash of an object linkBryce Kwon-7/+4
Trim a snapshot name without reading out of boundsBryce Kwon-29/+12
For a url of .git, or an empty one, repo_basename stepped its index to the byte before its buffer, read it, and would have cleared it had it held a slash. Git's strbuf trims take the same steps safely, and they lift the 1024-byte cap that failed the page for a longer url.
Drop two includes nothing in their files usesBryce Kwon-3/+0
Give stdout back from a slot in one placeBryce Kwon-10/+11
Use the parser's INT_MAX for every snapshot formatBryce Kwon-5/+1
The snapshots parser already answers all with INT_MAX, so cgit.c needed no value of its own for the same mask.
Hand back the fallback branch rather than a copyBryce Kwon-13/+4
Drop dead checks and a repeated filter cleanupBryce Kwon-12/+7
build_snapshot_setting always returns a buffer, both commit-sort values are tested on their own, authenticate_post ends the process, and the filters are cleaned up by the atexit handler once cmd_main returns.
Cap the search with xstrndup aloneBryce Kwon-4/+1
Return nothing from two calls nobody checksBryce Kwon-9/+7
Drop reencode's fixed target and unread resultBryce Kwon-12/+11
Every call converted into the page encoding and dropped what came back, and a commit's encoding is always set by the time it runs.
Rename prepare_repo_env to open_repoBryce Kwon-2/+2
It opens the repository and loads its notes, while cgit_prepare_repo_env exports the CGIT_REPO_ variables, and the two names were one prefix apart.
Explain the notes setup in one commentBryce Kwon-4/+3
Leave the scan's summary to its headerBryce Kwon-7/+3
Drop the scan's redundant stats and one-pass loopBryce Kwon-12/+11
The description and cgitrc readers already return when the file will not open, a repository's description is never NULL before it is read, and the owner lookup never went round a second time.
Strip a scanned path's suffixes with git's helpersBryce Kwon-10/+7
Give the Lua-less filter init the Lua block's elseBryce Kwon-6/+4
Allocate the filters zeroed with xcallocBryce Kwon-7/+2
Drop the exec filter's close steps that do nothingBryce Kwon-7/+1
A filter is only closed after an open has forked it, so its pid is a child's, and every open writes its arguments into argv afresh.
Format the cache listing's times where it printsBryce Kwon-17/+6
Close the cache's descriptors through one helperBryce Kwon-33/+15
Drop the cache's checks for arguments never NULLBryce Kwon-14/+0
The cache root always holds a default or a copy, the key comes from a strbuf, and every string hashed is the same or a macro expansion.