Skip to content

Commit

Permalink
add-server: use bigstringaf for bigstring type
Browse files Browse the repository at this point in the history
  • Loading branch information
seliopou committed Apr 20, 2019
1 parent fee87a7 commit 2872a2e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions lib/server_connection.mli
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module IOVec = Httpaf.IOVec
type 'handle t

type input_handlers =
{ frame : opcode:Websocket.Opcode.t -> is_fin:bool -> Bigstring.t -> off:int -> len:int -> unit
{ frame : opcode:Websocket.Opcode.t -> is_fin:bool -> Bigstringaf.t -> off:int -> len:int -> unit
; eof : unit -> unit }

val create
Expand All @@ -45,10 +45,10 @@ val create
-> 'handle t

val next_read_operation : _ t -> [ `Read | `Yield | `Close ]
val next_write_operation : _ t -> [ `Write of Bigstring.t IOVec.t list | `Yield | `Close of int ]
val next_write_operation : _ t -> [ `Write of Bigstringaf.t IOVec.t list | `Yield | `Close of int ]

val read : _ t -> Bigstring.t -> off:int -> len:int -> int
val read_eof : _ t -> Bigstring.t -> off:int -> len:int -> int
val read : _ t -> Bigstringaf.t -> off:int -> len:int -> int
val read_eof : _ t -> Bigstringaf.t -> off:int -> len:int -> int
val report_write_result : _ t -> [`Ok of int | `Closed ] -> unit

val yield_reader : _ t -> (unit -> unit) -> unit
Expand Down
6 changes: 3 additions & 3 deletions lib/server_handshake.mli
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ val create
-> 'handle t

val next_read_operation : _ t -> [ `Read | `Close | `Yield ]
val next_write_operation : _ t -> [ `Write of Bigstring.t IOVec.t list | `Yield | `Close of int ]
val next_write_operation : _ t -> [ `Write of Bigstringaf.t IOVec.t list | `Yield | `Close of int ]

val read : _ t -> Bigstring.t -> off:int -> len:int -> int
val read_eof : _ t -> Bigstring.t -> off:int -> len:int -> int
val read : _ t -> Bigstringaf.t -> off:int -> len:int -> int
val read_eof : _ t -> Bigstringaf.t -> off:int -> len:int -> int
val report_write_result : _ t -> [`Ok of int | `Closed ] -> unit

val yield_reader : _ t -> (unit -> unit) -> unit
Expand Down
4 changes: 2 additions & 2 deletions lib/server_websocket.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ type t =
; wsd : Wsd.t }

type input_handlers =
{ frame : opcode:Websocket.Opcode.t -> is_fin:bool -> Bigstring.t -> off:int -> len:int -> unit
; eof : unit -> unit }
{ frame : opcode:Websocket.Opcode.t -> is_fin:bool -> Bigstringaf.t -> off:int -> len:int -> unit
; eof : unit -> unit }

let create ~websocket_handler =
let mode = `Server in
Expand Down
10 changes: 5 additions & 5 deletions lib/server_websocket.mli
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ module IOVec = Httpaf.IOVec
type t

type input_handlers =
{ frame : opcode:Websocket.Opcode.t -> is_fin:bool -> Bigstring.t -> off:int -> len:int -> unit
; eof : unit -> unit }
{ frame : opcode:Websocket.Opcode.t -> is_fin:bool -> Bigstringaf.t -> off:int -> len:int -> unit
; eof : unit -> unit }

val create
: websocket_handler : (Wsd.t -> input_handlers)
-> t

val next_read_operation : t -> [ `Read | `Close ]
val next_write_operation : t -> [ `Write of Bigstring.t IOVec.t list | `Yield | `Close of int ]
val next_write_operation : t -> [ `Write of Bigstringaf.t IOVec.t list | `Yield | `Close of int ]

val read : t -> Bigstring.t -> off:int -> len:int -> int
val read_eof : t -> Bigstring.t -> off:int -> len:int -> int
val read : t -> Bigstringaf.t -> off:int -> len:int -> int
val read_eof : t -> Bigstringaf.t -> off:int -> len:int -> int
val report_write_result : t -> [`Ok of int | `Closed ] -> unit

val yield_writer : t -> (unit -> unit) -> unit
Expand Down

0 comments on commit 2872a2e

Please sign in to comment.