X-Git-Url: https://git.sesse.net/?p=remoteglot;a=blobdiff_plain;f=remoteglot.pl;h=35fe887382eaabb2cc0e0dd7be9a8809c9bf4eea;hp=163e16666cf108d41cbfbb271a2c0d3e6e1c035c;hb=ce5f6b655d5daa42abb79961aa18cf7b90db1f74;hpb=703728497c14b57cb2e7db9e90376ba82468ecf3 diff --git a/remoteglot.pl b/remoteglot.pl index 163e166..35fe887 100755 --- a/remoteglot.pl +++ b/remoteglot.pl @@ -67,7 +67,7 @@ select(TBLOG); $| = 1; select(STDOUT); -umask 0027; # analysis.json should not be served to users. +umask 0022; # analysis.json should not be served to users. # open the chess engine my $engine = open_engine($remoteglotconf::engine_cmdline, 'E1', sub { handle_uci(@_, 1); }); @@ -901,6 +901,7 @@ sub output_json { if (!$historic_json_only && exists($pos_calculating->{'history'})) { my %score_history = (); + local $dbh->{AutoCommit} = 0; my $q = $dbh->prepare('SELECT * FROM scores WHERE id=?'); my $pos = Position->start_pos('white', 'black'); my $halfmove_num = 0; @@ -917,6 +918,7 @@ sub output_json { ($pos) = $pos->make_pretty_move($move); } $q->finish; + $dbh->commit; # If at any point we are missing 10 consecutive moves, # truncate the history there. This is so we don't get into