diff options
author | stephan <stephan@noemail.net> | 2022-12-02 18:56:37 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2022-12-02 18:56:37 +0000 |
commit | bb4e4a4840530da37c6fdaabc9769a1996f25809 (patch) | |
tree | a272b6dcedc0fc44f32f59d60df18b46ce8eb09e /ext/wasm/api/sqlite3-opfs-async-proxy.js | |
parent | 95bc4d67bbc8abe0783605e5f98dc1689d213352 (diff) | |
download | sqlite-bb4e4a4840530da37c6fdaabc9769a1996f25809.tar.gz sqlite-bb4e4a4840530da37c6fdaabc9769a1996f25809.zip |
Minor internal tweaks to the OPFS VFS. Resolve a missing result code which lead to a null deref in xFileSize().
FossilOrigin-Name: 57dd593ef0efa17dfb3a9f4eac36d5b8b879e271de817d8cd94a8c8b56d31870
Diffstat (limited to 'ext/wasm/api/sqlite3-opfs-async-proxy.js')
-rw-r--r-- | ext/wasm/api/sqlite3-opfs-async-proxy.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/wasm/api/sqlite3-opfs-async-proxy.js b/ext/wasm/api/sqlite3-opfs-async-proxy.js index e77ff7809..339ec126d 100644 --- a/ext/wasm/api/sqlite3-opfs-async-proxy.js +++ b/ext/wasm/api/sqlite3-opfs-async-proxy.js @@ -295,7 +295,8 @@ const installAsyncProxy = function(self){ if(!fh.syncHandle){ const t = performance.now(); log("Acquiring sync handle for",fh.filenameAbs); - const maxTries = 5, msBase = state.asyncIdleWaitTime * 2; + const maxTries = 6, + msBase = state.asyncIdleWaitTime * 2; let i = 1, ms = msBase; for(; true; ms = msBase * ++i){ try { @@ -515,15 +516,14 @@ const installAsyncProxy = function(self){ xFileSize: async function(fid/*sqlite3_file pointer*/){ mTimeStart('xFileSize'); const fh = __openFiles[fid]; - let rc; + let rc = 0; wTimeStart('xFileSize'); try{ affirmLocked('xFileSize',fh); const sz = await (await getSyncHandle(fh,'xFileSize')).getSize(); state.s11n.serialize(Number(sz)); - rc = 0; }catch(e){ - state.s11n.storeException(2,e); + state.s11n.storeException(1,e); rc = GetSyncHandleError.convertRc(e,state.sq3Codes.SQLITE_IOERR); } await releaseImplicitLock(fh); |