[Libvir] xend_internal reads in bytes?

[Just an observation here - I'm busy with something else but may be able to take a closer look at this later.] Not only does xend_internal open a new connection for every HTTP request it makes, but it also reads the headers in as single bytes (but the body as a whole, presumably once it has Content-Length): connect(15, {sa_family=AF_FILE, path="/var/lib/xend/xend-socket"}, 27) = 0 write(15, "GET ", 4) = 4 write(15, "/xend/node/", 11) = 11 write(15, " HTTP/1.1\r\n", 11) = 11 write(15, "Host: localhost:8000\r\nAccept-Enc"..., 100) = 100 read(15, "H", 1) = 1 read(15, "T", 1) = 1 read(15, "T", 1) = 1 read(15, "P", 1) = 1 read(15, "/", 1) = 1 read(15, "1", 1) = 1 read(15, ".", 1) = 1 read(15, "1", 1) = 1 read(15, " ", 1) = 1 read(15, "2", 1) = 1 read(15, "0", 1) = 1 read(15, "0", 1) = 1 read(15, " ", 1) = 1 read(15, "O", 1) = 1 read(15, "K", 1) = 1 read(15, "\r", 1) = 1 read(15, "\n", 1) = 1 read(15, "C", 1) = 1 read(15, "o", 1) = 1 read(15, "n", 1) = 1 read(15, "t", 1) = 1 [...] read(15, "\n", 1) = 1 read(15, "\r", 1) = 1 read(15, "\n", 1) = 1 read(15, "(node (system Linux) (host oiras"..., 747) = 747 close(15) = 0 Rich. -- Emerging Technologies, Red Hat http://et.redhat.com/~rjones/ 64 Baker Street, London, W1U 7DF Mobile: +44 7866 314 421 Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Directors: Michael Cunningham (USA), Charlie Peters (USA) and David Owens (Ireland)

On Tue, Apr 03, 2007 at 09:29:22AM +0100, Richard W.M. Jones wrote:
[Just an observation here - I'm busy with something else but may be able to take a closer look at this later.]
Not only does xend_internal open a new connection for every HTTP request it makes, but it also reads the headers in as single bytes (but the body as a whole, presumably once it has Content-Length):
I fixed this previously, but IIRC we had to back out my fix due to a horrible bug in XenD. It was something like XenD would leak the socket into the QEMU device model, so if you did a big 8000 byte read we'd just block waiting on end of file which never came. Any Xen 3.0.3 or newer has a fix. We could probably re-instate my original fix cvs diff -r 1.18 -r 1.19 -up xend_internal.c Perhaps making the code conditional on xend_config_version >= 2 to avoid tickling the bugon 3.0.2 Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
participants (2)
-
Daniel P. Berrange
-
Richard W.M. Jones