<feed xmlns='http://www.w3.org/2005/Atom'>
<title>cgit-70/cache.c, branch v0.6</title>
<subtitle>a fork of cgit with a Gopher interface</subtitle>
<link rel='alternate' type='text/html' href='http://ns2.complex-networks.net/cgit-70/'/>
<entry>
<title>cache_safe_filename() needs more buffers</title>
<updated>2007-05-18T20:51:02+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-05-18T01:54:15+00:00</published>
<link rel='alternate' type='text/html' href='http://ns2.complex-networks.net/cgit-70/commit/?id=72fa5c63f80262019d807658cc537c9897c4b1d1'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Enable url=value querystring parameter</title>
<updated>2007-05-18T20:51:01+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-05-18T01:00:54+00:00</published>
<link rel='alternate' type='text/html' href='http://ns2.complex-networks.net/cgit-70/commit/?id=30ccdcaa74ebc0aab2b7843b0db8251d0ddf56de'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove troublesome chars from cachefile names</title>
<updated>2007-01-11T23:24:35+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-01-11T23:24:35+00:00</published>
<link rel='alternate' type='text/html' href='http://ns2.complex-networks.net/cgit-70/commit/?id=2c2047ff67a1e0053f95776e5079e432f69cea54'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a funtion cache_safe_filename() which replaces possibly bad filename
characters with '_'.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Move cache_prepare() to cgit</title>
<updated>2007-01-11T23:00:15+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2007-01-11T23:00:15+00:00</published>
<link rel='alternate' type='text/html' href='http://ns2.complex-networks.net/cgit-70/commit/?id=83a5f35a2724ee60bfd8c5679b98da7008272254'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This moves some cgit-specific stuff away from cache.c

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow relative paths for cgit_cache_root</title>
<updated>2006-12-16T12:55:58+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-16T12:55:58+00:00</published>
<link rel='alternate' type='text/html' href='http://ns2.complex-networks.net/cgit-70/commit/?id=7c849d94ec1cfecdec5a88d49f5af5c98f96ebca'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>cache_lock: do xstrdup/free on lockfile</title>
<updated>2006-12-12T09:16:41+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-12T09:16:41+00:00</published>
<link rel='alternate' type='text/html' href='http://ns2.complex-networks.net/cgit-70/commit/?id=58d04f6523b0029281d65f841859fa42d0c744ff'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't truncate valid cachefiles</title>
<updated>2006-12-11T21:53:50+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-11T21:53:50+00:00</published>
<link rel='alternate' type='text/html' href='http://ns2.complex-networks.net/cgit-70/commit/?id=fbaf1171b4e343929dd43ecac7cd9d1c692b84ec'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Avoid infinite loops in caching layer</title>
<updated>2006-12-11T11:10:12+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-11T11:10:12+00:00</published>
<link rel='alternate' type='text/html' href='http://ns2.complex-networks.net/cgit-70/commit/?id=318d106300102c19d114a4ea89265b0a4060d9cb'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix cache algorithm loophole</title>
<updated>2006-12-11T08:57:58+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-11T08:57:58+00:00</published>
<link rel='alternate' type='text/html' href='http://ns2.complex-networks.net/cgit-70/commit/?id=f5069d88dff7a7ed2f4665904b03e906cca75a7c'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This closes the door for unneccessary calls to cgit_fill_cache().

Noticed by Linus.

Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add license file and copyright notices</title>
<updated>2006-12-10T21:41:14+00:00</updated>
<author>
<name>Lars Hjemli</name>
<email>hjemli@gmail.com</email>
</author>
<published>2006-12-10T21:41:14+00:00</published>
<link rel='alternate' type='text/html' href='http://ns2.complex-networks.net/cgit-70/commit/?id=7640d90b73c01b16bb04ce4c541f52cbaae5f82a'/>
<id>7640d90b73c01b16bb04ce4c541f52cbaae5f82a</id>
<content type='text'>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Lars Hjemli &lt;hjemli@gmail.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
