search for: send_chunk

Displaying 10 results from an estimated 10 matches for "send_chunk".

Did you mean: read_chunk
2009 Aug 20
1
[PATCH libguestfs] daemon: diagnose socket write failure
...principle, we shouldn't ignore write failure: >From 56317a61bc22e935dc750cf669a164bacc12cf12 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyering at redhat.com> Date: Thu, 20 Aug 2009 12:29:46 +0200 Subject: [PATCH libguestfs] daemon: diagnose socket write failure * daemon/proto.c (send_chunk): Don't ignore socket-write error. --- daemon/proto.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/daemon/proto.c b/daemon/proto.c index 9b33902..c2dd50c 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -495,8 +495,10 @@ send_chunk (const guestfs_chunk *ch...
2004 Aug 06
2
buffer size from source to ice/shoutcast
Hello, I've built my own source for ICE/SHOUTcast, and it works pretty well except for one thing. After tuning into the server and listening for an 60-90 minutes you may hear a song skip ahead 30-90 seconds. I think I know why this is happening but I'mnot sure how to fix it. I think this is happening because my source is sending a little bit too much data to ICE/SHOUTcast. My formula
2004 Aug 06
0
buffer size from source to ice/shoutcast
...ise the kilobit definition used with mp3 is 1kbit = 1000bits/sec (Microsoft uses 1kbit=1024bits for it's media formats incidently). But your algorithm will suffer because sending the data will take a non-negligible time - better algorithm is tart = time(); sent = 0; while(1){ sent += send_chunk(); delta = time() - start; my_bitrate = sent *8 / delta; if(my_bitrate> target_bitrate){ sleep(1); /* (or any short time)*/ } } you maybe want to reset the sent/start parameters periodicly. Scott Manley --- >8 ---- List archives: http://www.xiph.org/a...
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...} buf = malloc (len); @@ -333,7 +333,7 @@ receive_file (receive_cb cb, void *opaque) } if (xread (sock, buf, len) == -1) - exit (1); + exit (EXIT_FAILURE); xdrmem_create (&xdr, buf, len, XDR_DECODE); memset (&chunk, 0, sizeof chunk); @@ -503,7 +503,7 @@ send_chunk (const guestfs_chunk *chunk) && xwrite (sock, buf, len) == 0 ? 0 : -1); if (err) { fprintf (stderr, "send_chunk: write failed\n"); - exit (1); + exit (EXIT_FAILURE); } return err; diff --git a/examples/hello.c b/examples/hello.c index 8b36ed4..b4...
2016 Apr 04
0
[PATCH 2/2] Use 'error' function for fprintf followed by exit.
...incoming message is too long (%u bytes)\n", - len); - exit (EXIT_FAILURE); - } + if (len > GUESTFS_MESSAGE_MAX) + error (EXIT_FAILURE, 0, "incoming message is too long (%u bytes)", len); buf = malloc (len); if (!buf) { @@ -617,10 +595,8 @@ send_chunk (const guestfs_chunk *chunk) int err = (xwrite (sock, lenbuf, 4) == 0 && xwrite (sock, buf, len) == 0 ? 0 : -1); - if (err) { - fprintf (stderr, "guestfsd: send_chunk: write failed\n"); - exit (EXIT_FAILURE); - } + if (err) + error (EXIT_FAILURE, 0,...
2016 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames. Rich.
2016 Mar 07
2
[PATCH v2] Use less stack.
...GUESTFS_MAX_CHUNK_SIZE, fp)) > 0) { if (send_file_write (buf, r) < 0) { pclose (fp); return -1; diff --git a/daemon/proto.c b/daemon/proto.c index 3d45dd5..61d376e 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -596,12 +596,19 @@ send_file_end (int cancel) static int send_chunk (const guestfs_chunk *chunk) { - char buf[GUESTFS_MAX_CHUNK_SIZE + 48]; + const size_t buf_len = GUESTFS_MAX_CHUNK_SIZE + 48; + CLEANUP_FREE char *buf = NULL; char lenbuf[4]; XDR xdr; uint32_t len; - xdrmem_create (&xdr, buf, sizeof buf, XDR_ENCODE); + buf = malloc (buf_len); +...
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
Wherever we had code which did: if (something_bad) { perror (...); exit (EXIT_FAILURE); } replace this with use of the error(3) function: if (something_bad) error (EXIT_FAILURE, errno, ...); The error(3) function is supplied by glibc, or by gnulib on platforms which don't have it, and is much more flexible than perror(3). Since we already use error(3), there seems to be
2010 Aug 31
13
[PATCH v2] Add progress bars
This is an updated and extended version of the original patch: https://www.redhat.com/archives/libguestfs/2010-August/msg00163.html This adds OCaml and Perl bindings (both tested), support for progress bars in virt-resize, and adds progress notifications to a number of the simpler commands. Still to do is to add progress messages to more commands. There are still a few commands which would be
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but separating them is a lot of work. With *both* patches applied, all the tests and extra-tests pass. That's no guarantee however that there isn't a mistake, so I don't think this patch is a candidate for the 1.16 branch, until it's had a lot more testing in development. Rich.