<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cgit/cache.c, branch v0.7</title>
<subtitle>A hyperfast web frontend for git repositories written in C.</subtitle>
<id>http://git.cetero.st/cgit/atom/cache.c?h=v0.7</id>
<link rel='self' href='http://git.cetero.st/cgit/atom/cache.c?h=v0.7'/>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/'/>
<updated>2007-05-18T20:51:02Z</updated>
<entry>
<title>cache_safe_filename() needs more buffers</title>
<updated>2007-05-18T20:51:02Z</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-05-18T01:54:15Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=72fa5c63f80262019d807658cc537c9897c4b1d1'/>
<id>urn:sha1:72fa5c63f80262019d807658cc537c9897c4b1d1</id>
<content type='text'>
The single static buffer makes it impossible to use the result of two
different calls to this function simultaneously. Fix it by using 4
buffers.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
</entry>
<entry>
<title>Enable url=value querystring parameter</title>
<updated>2007-05-18T20:51:01Z</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-05-18T01:00:54Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=30ccdcaa74ebc0aab2b7843b0db8251d0ddf56de'/>
<id>urn:sha1:30ccdcaa74ebc0aab2b7843b0db8251d0ddf56de</id>
<content type='text'>
This makes is possible to use repo-urls like '/pub/scm/git/git.git' and
even add path specifications, like '/pub/scm/git/git.git/log/documentation'.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
</entry>
<entry>
<title>Remove troublesome chars from cachefile names</title>
<updated>2007-01-11T23:24:35Z</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-01-11T23:24:35Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=2c2047ff67a1e0053f95776e5079e432f69cea54'/>
<id>urn:sha1:2c2047ff67a1e0053f95776e5079e432f69cea54</id>
<content type='text'>
Add a funtion cache_safe_filename() which replaces possibly bad filename
characters with '_'.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
</entry>
<entry>
<title>Move cache_prepare() to cgit</title>
<updated>2007-01-11T23:00:15Z</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-01-11T23:00:15Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=83a5f35a2724ee60bfd8c5679b98da7008272254'/>
<id>urn:sha1:83a5f35a2724ee60bfd8c5679b98da7008272254</id>
<content type='text'>
This moves some cgit-specific stuff away from cache.c

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
</entry>
<entry>
<title>Allow relative paths for cgit_cache_root</title>
<updated>2006-12-16T12:55:58Z</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-16T12:55:58Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=7c849d94ec1cfecdec5a88d49f5af5c98f96ebca'/>
<id>urn:sha1:7c849d94ec1cfecdec5a88d49f5af5c98f96ebca</id>
<content type='text'>
Make sure we chdir(2) back to the original getcwd(2) when a page
has been generated. Also, if the cgit_cache_root do not exist,
try to create it.

This is a feature intended to ease testing/debugging.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
</entry>
<entry>
<title>cache_lock: do xstrdup/free on lockfile</title>
<updated>2006-12-12T09:16:41Z</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-12T09:16:41Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=58d04f6523b0029281d65f841859fa42d0c744ff'/>
<id>urn:sha1:58d04f6523b0029281d65f841859fa42d0c744ff</id>
<content type='text'>
Since fmt() uses 8 alternating static buffers, and cache_lock might call
cache_create_dirs() multiple times, which in turn might call fmt() twice,
after four iterations lockfile would be overwritten by a cachedirectory
path.

In worst case, this could cause the cachedirectory to be unlinked and replaced
by a cachefile.

Fix: use xstrdup() on the result from fmt() before assigning to lockfile, and
call free(lockfile) before exit.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
</entry>
<entry>
<title>Don't truncate valid cachefiles</title>
<updated>2006-12-11T21:53:50Z</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-11T21:53:50Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=fbaf1171b4e343929dd43ecac7cd9d1c692b84ec'/>
<id>urn:sha1:fbaf1171b4e343929dd43ecac7cd9d1c692b84ec</id>
<content type='text'>
An embarrassing thinko in cgit_check_cache() would truncate valid cachefiles
in the following situation:
  1) process A notices a missing/expired cachefile
  2) process B gets scheduled, locks, fills and unlocks the cachefile
  3) process A gets scheduled, locks the cachefile, notices that the cachefile
     now exist/is not expired anymore, and continues to overwrite it with an
     empty lockfile.

Thanks to Linus for noticing (again).

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
</entry>
<entry>
<title>Avoid infinite loops in caching layer</title>
<updated>2006-12-11T11:10:12Z</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-11T11:10:12Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=318d106300102c19d114a4ea89265b0a4060d9cb'/>
<id>urn:sha1:318d106300102c19d114a4ea89265b0a4060d9cb</id>
<content type='text'>
Add a global variable, cgit_max_lock_attemps, to avoid the possibility of
infinite loops when failing to acquire a lockfile. This could happen on
broken setups or under crazy server load.

Incidentally, this also fixes a lurking bug in cache_lock() where an
uninitialized returnvalue was used.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
</entry>
<entry>
<title>Fix cache algorithm loophole</title>
<updated>2006-12-11T08:57:58Z</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-11T08:57:58Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=f5069d88dff7a7ed2f4665904b03e906cca75a7c'/>
<id>urn:sha1:f5069d88dff7a7ed2f4665904b03e906cca75a7c</id>
<content type='text'>
This closes the door for unneccessary calls to cgit_fill_cache().

Noticed by Linus.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
</entry>
<entry>
<title>Add license file and copyright notices</title>
<updated>2006-12-10T21:41:14Z</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-10T21:41:14Z</published>
<link rel='alternate' type='text/html' href='http://git.cetero.st/cgit/commit/?id=7640d90b73c01b16bb04ce4c541f52cbaae5f82a'/>
<id>urn:sha1:7640d90b73c01b16bb04ce4c541f52cbaae5f82a</id>
<content type='text'>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
</entry>
</feed>
