aboutsummaryrefslogtreecommitdiff
path: root/src/db.php
diff options
context:
space:
mode:
authorCassio de Campos <cassiopc@gmail.com>2017-11-01 17:35:22 +0000
committerCassio de Campos <cassiopc@gmail.com>2017-11-01 17:35:22 +0000
commit689ca417a57f7d3e7ba2836b09e493a61a13aac1 (patch)
tree8d97492e81f453a97c00c3e560864f586321b296 /src/db.php
parent9583d6ea7bb503fb0094751c5a871b3fb65de84a (diff)
parent6c7db3cfb3e72e6bf7bb8b5c530ec41fa03ec666 (diff)
downloadboca-689ca417a57f7d3e7ba2836b09e493a61a13aac1.tar.gz
boca-689ca417a57f7d3e7ba2836b09e493a61a13aac1.zip
Merge branch 'devel'
Diffstat (limited to 'src/db.php')
-rw-r--r--src/db.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/db.php b/src/db.php
index 2f6dd57..5948186 100644
--- a/src/db.php
+++ b/src/db.php
@@ -33,28 +33,28 @@ function DB_lo_open($conn, $file, $mode) {
else
return pg_lo_open ($conn, $file, $mode);
}
-function DB_lo_read_tobrowser($contest,$id) {
- $str = DB_lo_read($contest,$id);
- echo $str;
- return true;
+function DB_lo_read_tobrowser($contest,$id,$c=null) {
+ $str = DB_lo_read($contest,$id,-1,$c);
+ echo $str;
+ return true;
}
-function DB_lo_read($contest,$id,$s=-1) {
+function DB_lo_read($contest,$id,$s=-1,$c=null) {
if (strcmp(phpversion(),'4.2.0')<0) {
if($s<0) {
$str='';
- while (($buf = pg_loread ($id, 100000)) != false) $str .= $buf;
+ while (($buf = pg_loread ($id, 1000000)) != false) $str .= $buf;
} else
$str = pg_loread ($id, $s);
}
else {
if($s<0) {
$str='';
- while (($buf = pg_lo_read ($id, 100000)) != false) $str .= $buf;
+ while (($buf = pg_lo_read ($id, 1000000)) != false) $str .= $buf;
} else
$str = pg_lo_read ($id, $s);
}
- if(($str2 = DB_unlock($contest,$str))===false) return $str;
+ if(($str2 = DB_unlock($contest,$str,$c))===false) return $str;
return $str2;
}
function DB_unlock($contest,$str,$c=null) {
@@ -296,7 +296,7 @@ function DBcrc($contest,$id, $c=null) {
// just to return a unique string that will not match any other...
return "no-HASH-" . rand() . "-" . rand() . "-" . time();
}
- $str = DB_lo_read($contest,$f);
+ $str = DB_lo_read($contest,$f,-1,$c);
DB_lo_close($f);
if($docommit)
DBExec($c, "commit work", "DBcrc(commit)");