Mercurial > urweb
comparison src/settings.sml @ 865:ebefb0609ac3
Move http protocol into its own file
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 28 Jun 2009 11:49:04 -0400 |
parents | 60240acd15b9 |
children | 03e7f111fe99 |
comparison
equal
deleted
inserted
replaced
864:6304f5e8fbb4 | 865:ebefb0609ac3 |
---|---|
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 curProto = ref {name = "", |
265 link = clibFile "request.o" ^ " " ^ clibFile "queue.o" ^ " " ^ clibFile "http.o", | 265 link = "", |
266 persistent = true} | 266 persistent = false} |
267 | |
268 val () = addProtocol http | |
269 | |
270 val curProto = ref http | |
271 fun setProtocol name = | 267 fun setProtocol name = |
272 case getProtocol name of | 268 case getProtocol name of |
273 NONE => raise Fail ("Unknown protocol " ^ name) | 269 NONE => raise Fail ("Unknown protocol " ^ name) |
274 | SOME p => curProto := p | 270 | SOME p => curProto := p |
275 fun currentProtocol () = !curProto | 271 fun currentProtocol () = !curProto |