Skip to content

Instantly share code, notes, and snippets.

--- a/src/tcp/window.ml
+++ b/src/tcp/window.ml
@@ -61,11 +61,11 @@ let count_ackd_segs = MProf.Counter.make ~name:"tcp-ackd-segs"
(* To string for debugging *)
let pp fmt t =
Format.fprintf fmt
- "Window: rx_nxt=%a rx_nxt_inseq=%a tx_nxt=%a rx_wnd=%lu tx_wnd=%lu snd_una=%a backoffs=%d rto=%Lu"
+ "Window: rx_nxt=%a rx_nxt_inseq=%a tx_nxt=%a rx_wnd=%lu tx_wnd=%lu cwnd=%lu snd_una=%a backoffs=%d rto=%Lu"
Sequence.pp t.rx_nxt
(*
* Compile with
ocamlfind ocamlopt -package cryptokit,tcpip.tcp,lwt.ppx,mirage-clock-unix,mirage-vnetif,mirage-net-lwt,tcpip.ethif,tcpip.arpv4,tcpip.icmpv4,tcpip.ipv4,tcpip.stack-direct,logs,lwt.unix,logs.fmt,io-page.unix -thread -o tcpip_bug tcpip_bug.ml -linkpkg
* *)
open Lwt.Infix
let mtu = 4000
@mfp
mfp / countries-without-postcodes.rb
Created April 24, 2017 08:54
Countries without postal codes
COUNTRIES_WITHOUT_POSTCODES = [
[ "Angola", "AO" ],
[ "Antigua and Barbuda", "AG" ],
[ "Aruba", "AW" ],
[ "Bahamas", "BS" ],
[ "Belize", "BZ" ],
[ "Benin", "BJ" ],
[ "Botswana", "BW" ],
[ "Burkina Faso", "BF" ],
[ "Burundi", "BI" ],
@mfp
mfp / region.ml
Last active February 21, 2017 16:28
turn any iter_s into bounded concurrency iter_n with dynamic limit
(*
* ocamlfind ocamlc -package lwt,lwt.unix -o region region.ml -linkpkg
* *)
module Region : sig
type t
val make : int -> t
val resize : t -> int -> unit
val enter : t -> int -> (unit -> 'a Lwt.t) -> 'a Lwt.t
val enter_p : t -> int -> (unit -> unit Lwt.t) -> unit Lwt.t
open Lwt
include Inotify
let section = Lwt_log.Section.make "inotify_lwt"
external struct_size : unit -> int = "stub_inotify_struct_size"
external convert : string -> (wd * type_event list * int32 * int)
= "stub_inotify_convert"
exception Error of string * int
type select_event =
Inotify.select_event =
S_Access
| S_Attrib
| S_Close_write
| S_Close_nowrite
| S_Create
| S_Delete
diff --git a/triangle.ml b/triangle.ml
index ba35331..8323f1d 100644
--- a/triangle.ml
+++ b/triangle.ml
@@ -33,10 +33,8 @@ let tolerance_k = 1.0 /. 1024.0 ;;
*)
type t = {
vertexs_m : vT array;
+ vectors_c : vT array;
edge0 : vT; edge1 : vT; edge3 : vT;
module ReloadPage_ = struct
open XHTML.M
open Xhtmltypes
open Ocsigen_http_frame
open Eliom_services
type page = exn list
type options = [ `HTTP11 | `OldCompat ]