Mercurial > urweb
comparison src/settings.sml @ 858:346cf1908a17
Avoid using prepared statements for non-persistent protocols
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 27 Jun 2009 10:50:45 -0400 |
parents | 3d2f6cb6d54a |
children | 60240acd15b9 |
comparison
equal
deleted
inserted
replaced
857:3d2f6cb6d54a | 858:346cf1908a17 |
---|---|
250 | 250 |
251 | 251 |
252 type protocol = { | 252 type protocol = { |
253 name : string, | 253 name : string, |
254 link : string, | 254 link : string, |
255 supportsPush : bool | 255 persistent : bool |
256 } | 256 } |
257 val protocols = ref ([] : protocol list) | 257 val protocols = ref ([] : protocol list) |
258 fun addProtocol p = protocols := p :: !protocols | 258 fun addProtocol p = protocols := p :: !protocols |
259 fun getProtocol s = List.find (fn p => #name p = s) (!protocols) | 259 fun getProtocol s = List.find (fn p => #name p = s) (!protocols) |
260 | 260 |
261 fun clibFile s = OS.Path.joinDirFile {dir = Config.libC, | 261 fun clibFile s = OS.Path.joinDirFile {dir = Config.libC, |
262 file = s} | 262 file = s} |
263 | 263 |
264 val http = {name = "http", | 264 val http = {name = "http", |
265 link = clibFile "request.o" ^ " " ^ clibFile "http.o", | 265 link = clibFile "request.o" ^ " " ^ clibFile "http.o", |
266 supportsPush = true} | 266 persistent = true} |
267 | 267 |
268 val () = addProtocol http | 268 val () = addProtocol http |
269 val () = addProtocol {name = "cgi", | |
270 link = clibFile "request.o" ^ " " ^ clibFile "cgi.o", | |
271 supportsPush = false} | |
272 | 269 |
273 val curProto = ref http | 270 val curProto = ref http |
274 fun setProtocol name = | 271 fun setProtocol name = |
275 case getProtocol name of | 272 case getProtocol name of |
276 NONE => raise Fail ("Unknown protocol " ^ name) | 273 NONE => raise Fail ("Unknown protocol " ^ name) |