mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
remove dead code
This commit is contained in:
parent
c1038e5b77
commit
7c765a181d
2 changed files with 3 additions and 25 deletions
|
|
@ -178,31 +178,6 @@ module Input = struct
|
||||||
len := !len - n
|
len := !len - n
|
||||||
done
|
done
|
||||||
|
|
||||||
let append (i1 : #t) (i2 : #t) : t =
|
|
||||||
let use_i1 = ref true in
|
|
||||||
let rec input_rec (slice : Slice.t) =
|
|
||||||
if !use_i1 then (
|
|
||||||
slice.len <- input i1 slice.bytes 0 (Bytes.length slice.bytes);
|
|
||||||
if slice.len = 0 then (
|
|
||||||
use_i1 := false;
|
|
||||||
input_rec slice
|
|
||||||
)
|
|
||||||
) else
|
|
||||||
slice.len <- input i1 slice.bytes 0 (Bytes.length slice.bytes)
|
|
||||||
in
|
|
||||||
|
|
||||||
object
|
|
||||||
inherit Iostream.In_buf.t_from_refill ()
|
|
||||||
|
|
||||||
method private refill (slice : Slice.t) =
|
|
||||||
slice.off <- 0;
|
|
||||||
input_rec slice
|
|
||||||
|
|
||||||
method close () =
|
|
||||||
close i1;
|
|
||||||
close i2
|
|
||||||
end
|
|
||||||
|
|
||||||
let iter_slice (f : Slice.t -> unit) (self : #t) : unit =
|
let iter_slice (f : Slice.t -> unit) (self : #t) : unit =
|
||||||
let continue = ref true in
|
let continue = ref true in
|
||||||
while !continue do
|
while !continue do
|
||||||
|
|
|
||||||
|
|
@ -299,6 +299,9 @@ module Reader = struct
|
||||||
let rec read_rec (self : t) buf i len : int =
|
let rec read_rec (self : t) buf i len : int =
|
||||||
match self.state with
|
match self.state with
|
||||||
| Close -> 0
|
| Close -> 0
|
||||||
|
| Reading_frame r when r.remaining_bytes = 0 ->
|
||||||
|
self.state <- Begin;
|
||||||
|
read_rec self buf i len
|
||||||
| Reading_frame r ->
|
| Reading_frame r ->
|
||||||
let len = min len r.remaining_bytes in
|
let len = min len r.remaining_bytes in
|
||||||
let n = IO.Input.input self.ic buf i len in
|
let n = IO.Input.input self.ic buf i len in
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue