diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-02-21 08:55:28 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-02-21 08:55:28 +0000 |
commit | c60477228c6b4d5e00c7bdb3b895e9f30d00ea97 (patch) | |
tree | 03b0c2eceadcc57a732eca6a054dff92fbd4eb56 /IkiWiki/Plugin | |
parent | 24b83435061f94c6e203ed1b31b114b53ab8b8a3 (diff) | |
download | ikiwiki-c60477228c6b4d5e00c7bdb3b895e9f30d00ea97.tar ikiwiki-c60477228c6b4d5e00c7bdb3b895e9f30d00ea97.tar.gz |
* Since the CGI had to drop the wiki lock to avoid deadlocking the
commit hook, it was possible for one CGI to race another one and "win"
the commit of both their files. This race has been fixed by adding a new
commitlock, which when locked by the CGI, disables the commit hook
(except for commit mails). The CGI then takes care of the updates the
commit hook would have done.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/poll.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/IkiWiki/Plugin/poll.pm b/IkiWiki/Plugin/poll.pm index a3321a32e..4eae6a349 100644 --- a/IkiWiki/Plugin/poll.pm +++ b/IkiWiki/Plugin/poll.pm @@ -125,17 +125,17 @@ sub cgi ($) { #{{{ IkiWiki::cgi_savesession($session); $oldchoice=$session->param($choice_param); if ($config{rcs}) { - # prevent deadlock with post-commit hook - IkiWiki::unlockwiki(); + disable_commit_hook(); IkiWiki::rcs_commit($pagesources{$page}, "poll vote ($choice)", IkiWiki::rcs_prepedit($pagesources{$page}), $session->param("name"), $ENV{REMOTE_ADDR}); + enable_commit_hook(); + rcs_update(); } - else { - require IkiWiki::Render; - IkiWiki::refresh(); - IkiWiki::saveindex(); - } + require IkiWiki::Render; + IkiWiki::refresh(); + IkiWiki::saveindex(); + # Need to set cookie in same http response that does the # redir. eval q{use CGI::Cookie}; |