comparison src/effectize.sml @ 1936:6745eafff617

Start SQL transactions as read-only when possible, based on conservative program analysis
author Adam Chlipala <adam@chlipala.net>
date Thu, 12 Dec 2013 17:42:48 -0500
parents d54984564bcd
children b4702145f8de
comparison
equal deleted inserted replaced
1935:fda9d5af69e7 1936:6745eafff617
151 evs 151 evs
152 end 152 end
153 in 153 in
154 (d, loop (writers, readers, pushers)) 154 (d, loop (writers, readers, pushers))
155 end 155 end
156 | DExport (Link, n, t) => 156 | DExport (Link _, n, t) =>
157 (case IM.find (writers, n) of 157 (case IM.find (writers, n) of
158 NONE => () 158 NONE => ()
159 | SOME (loc, s) => 159 | SOME (loc, s) =>
160 if Settings.isSafeGet s then 160 if Settings.isSafeGet s then
161 () 161 ()
162 else 162 else
163 ErrorMsg.errorAt loc ("A handler (URI prefix \"" ^ s 163 ErrorMsg.errorAt loc ("A handler (URI prefix \"" ^ s
164 ^ "\") 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"); 164 ^ "\") 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");
165 ((DExport (Link, n, IM.inDomain (pushers, n)), #2 d), evs)) 165 ((DExport (Link (if IM.inDomain (writers, n) then
166 if IM.inDomain (readers, n) then
167 ReadCookieWrite
168 else
169 ReadWrite
170 else
171 ReadOnly), n, IM.inDomain (pushers, n)), #2 d), evs))
166 | DExport (Action _, n, _) => 172 | DExport (Action _, n, _) =>
167 ((DExport (Action (if IM.inDomain (writers, n) then 173 ((DExport (Action (if IM.inDomain (writers, n) then
168 if IM.inDomain (readers, n) then 174 if IM.inDomain (readers, n) then
169 ReadCookieWrite 175 ReadCookieWrite
170 else 176 else