summaryrefslogtreecommitdiff
path: root/src/effectize.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2013-12-12 17:42:48 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2013-12-12 17:42:48 -0500
commit3fbffffb0b03b980de3ae2e579fc41c3723a5b46 (patch)
treed3c882ae31c045044de6538db6dc9e13cf347f66 /src/effectize.sml
parent7b68961399bb9e1576e1355c084bb2a95853c03a (diff)
Start SQL transactions as read-only when possible, based on conservative program analysis
Diffstat (limited to 'src/effectize.sml')
-rw-r--r--src/effectize.sml10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/effectize.sml b/src/effectize.sml
index 6ced952b..d711e620 100644
--- a/src/effectize.sml
+++ b/src/effectize.sml
@@ -153,7 +153,7 @@ fun effectize file =
in
(d, loop (writers, readers, pushers))
end
- | DExport (Link, n, t) =>
+ | DExport (Link _, n, t) =>
(case IM.find (writers, n) of
NONE => ()
| SOME (loc, s) =>
@@ -162,7 +162,13 @@ fun effectize file =
else
ErrorMsg.errorAt loc ("A handler (URI prefix \"" ^ s
^ "\") accessible via GET could cause side effects; try accessing it only via forms, removing it from the signature of the main program module, or whitelisting it with the 'safeGet' .urp directive");
- ((DExport (Link, n, IM.inDomain (pushers, n)), #2 d), evs))
+ ((DExport (Link (if IM.inDomain (writers, n) then
+ if IM.inDomain (readers, n) then
+ ReadCookieWrite
+ else
+ ReadWrite
+ else
+ ReadOnly), n, IM.inDomain (pushers, n)), #2 d), evs))
| DExport (Action _, n, _) =>
((DExport (Action (if IM.inDomain (writers, n) then
if IM.inDomain (readers, n) then