Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

90 lines (72 sloc) 2.955 kB
(*
Copyright © 2011 MLstate
This file is part of OPA.
OPA is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.
OPA is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.
You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <http://www.gnu.org/licenses/>.
*)
(* Generated by mkrp.ml - Wed, 15 Dec 2010 12:31:00 GMT *)
open Requestdef
open RequestType
exception ParseFail_typ of int
let typ_scmp s1 s2 m n =
let p = ref m in
while !p < n && Char.lowercase (String.unsafe_get s1 (!p)) = Char.lowercase (String.unsafe_get s2 (!p)) do incr p done;
!p = n
let typ_fail (_:string -> int -> int -> string -> int -> int -> _method -> int * parse_request) (_typ:string) (_typlen:int) (nxt:int) (_req:string) (_reqlen:int) = raise (ParseFail_typ nxt)
let typ_tab = Array.make 50 typ_fail
let typC rpfn typ typlen nxt req reqlen =
if typ_scmp typ "CONNECT" 1 7
then rpfn typ typlen nxt req reqlen 7 Connect
else raise (ParseFail_typ nxt)
let _ = typ_tab.(0) <- typC
let _ = typ_tab.(32) <- typC
let typD rpfn typ typlen nxt req reqlen =
if typ_scmp typ "DELETE" 1 6
then rpfn typ typlen nxt req reqlen 6 Delete
else raise (ParseFail_typ nxt)
let _ = typ_tab.(1) <- typD
let _ = typ_tab.(33) <- typD
let typG rpfn typ typlen nxt req reqlen =
if typ_scmp typ "GET" 1 3
then rpfn typ typlen nxt req reqlen 3 Get
else raise (ParseFail_typ nxt)
let _ = typ_tab.(4) <- typG
let _ = typ_tab.(36) <- typG
let typH rpfn typ typlen nxt req reqlen =
if typ_scmp typ "HEAD" 1 4
then rpfn typ typlen nxt req reqlen 4 Head
else raise (ParseFail_typ nxt)
let _ = typ_tab.(5) <- typH
let _ = typ_tab.(37) <- typH
let typO rpfn typ typlen nxt req reqlen =
if typ_scmp typ "OPTIONS" 1 7
then rpfn typ typlen nxt req reqlen 7 Options
else raise (ParseFail_typ nxt)
let _ = typ_tab.(12) <- typO
let _ = typ_tab.(44) <- typO
let typP rpfn typ typlen nxt req reqlen =
if typ_scmp typ "POST" 1 4
then rpfn typ typlen nxt req reqlen 4 Post
else if typ_scmp typ "PUT" 1 3
then rpfn typ typlen nxt req reqlen 3 Put
else raise (ParseFail_typ nxt)
let _ = typ_tab.(13) <- typP
let _ = typ_tab.(45) <- typP
let typT rpfn typ typlen nxt req reqlen =
if typ_scmp typ "TRACE" 1 5
then rpfn typ typlen nxt req reqlen 5 Trace
else raise (ParseFail_typ nxt)
let _ = typ_tab.(17) <- typT
let _ = typ_tab.(49) <- typT
let typ_mms = [|('C','t')|]
let typ_call rpfn typ typlen nxt req reqlen =
let c0 = String.unsafe_get typ 0 in
if c0 < 'C' || c0 > 't' then raise (ParseFail_typ nxt);
typ_tab.((Char.code c0)-67) rpfn typ typlen nxt req reqlen
Jump to Line
Something went wrong with that request. Please try again.