|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
From f13fe5903361953e4ccf8602b9c8df7e64568d55 Mon Sep 17 00:00:00 2001
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edvin.torok@citrix.com>
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Date: Wed, 12 Oct 2022 19:13:02 +0100
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Subject: tools/ocaml: Change Xb.input to return Packet.t option
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
MIME-Version: 1.0
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Content-Type: text/plain; charset=UTF-8
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Content-Transfer-Encoding: 8bit
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
The queue here would only ever hold at most one element. This will simplify
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
follow-up patches.
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
This is part of XSA-326.
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Reported-by: Julien Grall <jgrall@amazon.com>
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Acked-by: Christian Lindig <christian.lindig@citrix.com>
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
diff --git a/tools/ocaml/libs/xb/xb.ml b/tools/ocaml/libs/xb/xb.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
index 8404ddd8a682..165fd4a1edf4 100644
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
--- a/tools/ocaml/libs/xb/xb.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+++ b/tools/ocaml/libs/xb/xb.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -45,7 +45,6 @@ type partial_buf = HaveHdr of Partial.pkt | NoHdr of int * bytes
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
type t =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
{
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
backend: backend;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- pkt_in: Packet.t Queue.t;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
pkt_out: Packet.t Queue.t;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
mutable partial_in: partial_buf;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
mutable partial_out: string;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -62,7 +61,6 @@ let reconnect t = match t.backend with
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Xs_ring.close backend.mmap;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
backend.eventchn_notify ();
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
(* Clear our old connection state *)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- Queue.clear t.pkt_in;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Queue.clear t.pkt_out;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
t.partial_in <- init_partial_in ();
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
t.partial_out <- ""
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -124,7 +122,6 @@ let output con =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
(* NB: can throw Reconnect *)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let input con =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- let newpacket = ref false in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let to_read =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
match con.partial_in with
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
| HaveHdr partial_pkt -> Partial.to_complete partial_pkt
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -143,21 +140,19 @@ let input con =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
if Partial.to_complete partial_pkt = 0 then (
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let pkt = Packet.of_partialpkt partial_pkt in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
con.partial_in <- init_partial_in ();
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- Queue.push pkt con.pkt_in;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- newpacket := true
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- )
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ Some pkt
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ ) else None
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
| NoHdr (i, buf) ->
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
(* we complete the partial header *)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
if sz > 0 then
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Bytes.blit b 0 buf (Partial.header_size () - i) sz;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
con.partial_in <- if sz = i then
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- HaveHdr (Partial.of_string (Bytes.to_string buf)) else NoHdr (i - sz, buf)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- );
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- !newpacket
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ HaveHdr (Partial.of_string (Bytes.to_string buf)) else NoHdr (i - sz, buf);
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ None
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ )
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let newcon backend = {
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
backend = backend;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- pkt_in = Queue.create ();
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
pkt_out = Queue.create ();
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
partial_in = init_partial_in ();
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
partial_out = "";
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -193,9 +188,6 @@ let has_output con = has_new_output con || has_old_output con
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let peek_output con = Queue.peek con.pkt_out
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
-let input_len con = Queue.length con.pkt_in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
-let has_in_packet con = Queue.length con.pkt_in > 0
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
-let get_in_packet con = Queue.pop con.pkt_in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let has_partial_input con = match con.partial_in with
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
| HaveHdr _ -> true
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
| NoHdr (n, _) -> n < Partial.header_size ()
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
diff --git a/tools/ocaml/libs/xb/xb.mli b/tools/ocaml/libs/xb/xb.mli
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
index 794e35bb343e..91c682162cea 100644
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
--- a/tools/ocaml/libs/xb/xb.mli
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+++ b/tools/ocaml/libs/xb/xb.mli
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -77,7 +77,7 @@ val write_fd : backend_fd -> 'a -> string -> int -> int
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val write_mmap : backend_mmap -> 'a -> string -> int -> int
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val write : t -> string -> int -> int
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val output : t -> bool
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
-val input : t -> bool
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+val input : t -> Packet.t option
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val newcon : backend -> t
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val open_fd : Unix.file_descr -> t
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val open_mmap : Xenmmap.mmap_interface -> (unit -> unit) -> t
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -89,10 +89,7 @@ val has_new_output : t -> bool
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val has_old_output : t -> bool
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val has_output : t -> bool
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val peek_output : t -> Packet.t
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
-val input_len : t -> int
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
-val has_in_packet : t -> bool
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val has_partial_input : t -> bool
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
-val get_in_packet : t -> Packet.t
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val has_more_input : t -> bool
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val is_selectable : t -> bool
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
val get_fd : t -> Unix.file_descr
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
diff --git a/tools/ocaml/libs/xs/xsraw.ml b/tools/ocaml/libs/xs/xsraw.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
index d982fb24dbb1..451f8b38dbcc 100644
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
--- a/tools/ocaml/libs/xs/xsraw.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+++ b/tools/ocaml/libs/xs/xsraw.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -94,26 +94,18 @@ let pkt_send con =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
done
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
(* receive one packet - can sleep *)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
-let pkt_recv con =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- let workdone = ref false in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- while not !workdone
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- do
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- workdone := Xb.input con.xb
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- done;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- Xb.get_in_packet con.xb
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+let rec pkt_recv con =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ match Xb.input con.xb with
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ | Some packet -> packet
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ | None -> pkt_recv con
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let pkt_recv_timeout con timeout =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let fd = Xb.get_fd con.xb in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let r, _, _ = Unix.select [ fd ] [] [] timeout in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
if r = [] then
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
true, None
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- else (
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- let workdone = Xb.input con.xb in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- if workdone then
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- false, (Some (Xb.get_in_packet con.xb))
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- else
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- false, None
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- )
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ else
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ false, Xb.input con.xb
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let queue_watchevent con data =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let ls = split_string ~limit:2 '\000' data in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
diff --git a/tools/ocaml/xenstored/connection.ml b/tools/ocaml/xenstored/connection.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
index 38b47363a173..cc20e047d2b9 100644
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
--- a/tools/ocaml/xenstored/connection.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+++ b/tools/ocaml/xenstored/connection.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -277,9 +277,7 @@ let get_transaction con tid =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Hashtbl.find con.transactions tid
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let do_input con = Xenbus.Xb.input con.xb
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
-let has_input con = Xenbus.Xb.has_in_packet con.xb
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let has_partial_input con = Xenbus.Xb.has_partial_input con.xb
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
-let pop_in con = Xenbus.Xb.get_in_packet con.xb
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let has_more_input con = Xenbus.Xb.has_more_input con.xb
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let has_output con = Xenbus.Xb.has_output con.xb
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -307,7 +305,7 @@ let is_bad con = match con.dom with None -> false | Some dom -> Domain.is_bad_do
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Restrictions below can be relaxed once xenstored learns to dump more
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
of its live state in a safe way *)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let has_extra_connection_data con =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- let has_in = has_input con || has_partial_input con in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ let has_in = has_partial_input con in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let has_out = has_output con in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let has_socket = con.dom = None in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let has_nondefault_perms = make_perm con.dom <> con.perm in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
diff --git a/tools/ocaml/xenstored/process.ml b/tools/ocaml/xenstored/process.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
index 6a3435c265d3..2d67456a2aa0 100644
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
--- a/tools/ocaml/xenstored/process.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+++ b/tools/ocaml/xenstored/process.ml
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -195,10 +195,9 @@ let parse_live_update args =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
| _ when Unix.gettimeofday () < t.deadline -> false
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
| l ->
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
warn "timeout reached: have to wait, migrate or shutdown %d domains:" (List.length l);
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- let msgs = List.rev_map (fun con -> Printf.sprintf "%s: %d tx, in: %b, out: %b, perm: %s"
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ let msgs = List.rev_map (fun con -> Printf.sprintf "%s: %d tx, out: %b, perm: %s"
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
(Connection.get_domstr con)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
(Connection.number_of_transactions con)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- (Connection.has_input con)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
(Connection.has_output con)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
(Connection.get_perm con |> Perms.Connection.to_string)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
) l in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -705,16 +704,17 @@ let do_input store cons doms con =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
info "%s requests a reconnect" (Connection.get_domstr con);
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
History.reconnect con;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
info "%s reconnection complete" (Connection.get_domstr con);
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- false
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ None
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
| Failure exp ->
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
error "caught exception %s" exp;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
error "got a bad client %s" (sprintf "%-8s" (Connection.get_domstr con));
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
Connection.mark_as_bad con;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- false
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ None
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- if newpacket then (
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- let packet = Connection.pop_in con in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ match newpacket with
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ | None -> ()
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ | Some packet ->
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let tid, rid, ty, data = Xenbus.Xb.Packet.unpack packet in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let req = {Packet.tid=tid; Packet.rid=rid; Packet.ty=ty; Packet.data=data} in
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
@@ -724,8 +724,7 @@ let do_input store cons doms con =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
(Xenbus.Xb.Op.to_string ty) (sanitize_data data); *)
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
process_packet ~store ~cons ~doms ~con ~req;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
write_access_log ~ty ~tid ~con:(Connection.get_domstr con) ~data;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- Connection.incr_ops con;
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
- )
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
+ Connection.incr_ops con
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
let do_output _store _cons _doms con =
|
|
![](https://seccdn.libravatar.org/avatar/f1a0ddfc363b14e167bf8548e95f340032d1964ae5b6ea4f235e351fd948008e?s=16&d=retro) |
97374c0 |
if Connection.has_output con then (
|