Displaying 20 results from an estimated 3000 matches similar to: "[PATCH] Fix lossy conversion of Content-Length"
2020 Jan 09
2
Re: [PATCH] Fix lossy conversion of Content-Length
On Wed, Jan 08, 2020 at 07:19:56AM -0600, Eric Blake wrote:
> On 1/7/20 4:13 AM, Adrian Ambrożewicz wrote:
> >Actual variable holding content length is int64_t, but it was assigned
> >by explicit cast to size_t. On 32-bit systems it's a lossy conversion,
> >so it was replaced by casting to int64_t instead.
> >
> >Signed-off-by: Adrian Ambrożewicz
2020 Jan 09
2
Re: [PATCH] Fix lossy conversion of Content-Length
On Thursday, 9 January 2020 17:41:58 CET Adrian Ambrożewicz wrote:
> W dniu 1/9/2020 o 14:07, Richard W.M. Jones pisze:
> > On Wed, Jan 08, 2020 at 07:19:56AM -0600, Eric Blake wrote:
> >> On 1/7/20 4:13 AM, Adrian Ambrożewicz wrote:
> >>> Actual variable holding content length is int64_t, but it was assigned
> >>> by explicit cast to size_t. On 32-bit
2020 Jan 08
0
Re: [PATCH] Fix lossy conversion of Content-Length
On 1/7/20 4:13 AM, Adrian Ambrożewicz wrote:
> Actual variable holding content length is int64_t, but it was assigned
> by explicit cast to size_t. On 32-bit systems it's a lossy conversion,
> so it was replaced by casting to int64_t instead.
>
> Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>
> ---
> plugins/curl/curl.c | 2 +-
> 1 file
2020 Jan 09
0
Re: [PATCH] Fix lossy conversion of Content-Length
W dniu 1/9/2020 o 14:07, Richard W.M. Jones pisze:
> On Wed, Jan 08, 2020 at 07:19:56AM -0600, Eric Blake wrote:
>> On 1/7/20 4:13 AM, Adrian Ambrożewicz wrote:
>>> Actual variable holding content length is int64_t, but it was assigned
>>> by explicit cast to size_t. On 32-bit systems it's a lossy conversion,
>>> so it was replaced by casting to int64_t
2020 Jan 10
0
[PATCH v2] Fix lossy conversion of Content-Length
From a120342e0d3d20962396e6bf5bd5ac30c66b5983 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrian=20Ambro=C5=BCewicz?=
<adrian.ambrozewicz@linux.intel.com>
Date: Tue, 7 Jan 2020 11:07:08 +0100
Subject: [PATCH 1/1] Fix lossy conversion of Content-Length
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Actual variable holding content length is int64_t,
2020 Jan 08
1
[nbdkit PATCH] curl: use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T when available
Use CURLINFO_CONTENT_LENGTH_DOWNLOAD_T for curl_easy_getinfo() (added in
curl 7.55.0) to get the length of a remote file, instead of the old
CURLINFO_CONTENT_LENGTH_DOWNLOAD. This way the size is already a 64-bit
integer value, as opposed to a double (the old information).
---
plugins/curl/curl.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/plugins/curl/curl.c
2016 Sep 26
1
[PATCH] nbdkit: flags are 32 bits for oldstyle connections
# HG changeset patch
# User Carl-Daniel Hailfinger <Carl-Daniel.Hailfinger@inf.h-brs.de>
# Date 1474903734 -7200
# Mon Sep 26 17:28:54 2016 +0200
# Node ID dbd1ea0a401cedcfa426097a289d852971b14f1e
# Parent d7d5078d08c711032837dcac79a4450226ec2ce5
nbdkit: Fix flags in old-style connection
diff -r d7d5078d08c7 -r dbd1ea0a401c src/connections.c
--- a/src/connections.c Sun Sep 25 05:04:02
2017 Nov 15
1
[nbdkit PATCH] connections: Extract common export flag computation code
No need to duplicate maintenance of export flag computation between
old and new style handshakes.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
src/connections.c | 120 +++++++++++++++++++++---------------------------------
1 file changed, 47 insertions(+), 73 deletions(-)
diff --git a/src/connections.c b/src/connections.c
index 8dc1925..f9edea7 100644
--- a/src/connections.c
+++
2018 Aug 04
3
[PATCH nbdkit] protocol: Implement NBD_OPT_GO.
This is only lightly tested (against just qemu NBD client), and the
code might be structured a little better as the
_negotiate_handshake_newstyle_options function has now grown to be
huge. Anyway works for me.
Rich.
2018 Aug 06
3
[PATCH nbdkit v2] protocol: Implement NBD_OPT_GO.
There's no substantial difference over v1, I simply fixed a few
whitespace issues, moved one struct around and tidied up the comments.
Rich.
2018 Aug 06
0
[PATCH nbdkit v2] protocol: Implement NBD_OPT_GO.
---
src/connections.c | 233 +++++++++++++++++++++++++++++++++++++---------
src/protocol.h | 27 ++++--
2 files changed, 209 insertions(+), 51 deletions(-)
diff --git a/src/connections.c b/src/connections.c
index ba6e91d..4e9b191 100644
--- a/src/connections.c
+++ b/src/connections.c
@@ -75,7 +75,9 @@ struct connection {
void **handles;
size_t nr_handles;
+ uint32_t cflags;
2017 Nov 15
1
[nbdkit PATCH] connections: Improve error responses
We had several inconsistencies from the NBD spec when diagnosing
bad client messages:
- FLUSH is not generally forbidden on a read-only export (so failing
with EPERM is wrong) [meanwhile, if we don't advertise flush because
plugin_can_flush() fails, then rejecting with EINVAL is still okay]
- returning EPERM (aka EROFS) for read-only exports should probably
take precedence over anything else
-
2023 Aug 04
2
[libnbd PATCH v4 01/25] block_status: Add some sanity checking of server lengths
On Wed, Aug 02, 2023 at 08:50:21PM -0500, Eric Blake wrote:
> Previously, we had not been doing any validation of server extent
> responses, which means a client query at an offset near the end of the
> export can result in a buggy server sending a response longer than the
> export length and potentially confusing the client. The NBD spec also
> says that an extent length should be
2019 Aug 30
0
[nbdkit PATCH 5/9] server: Cache per-connection size
We don't know how long a plugin's .get_size() will take, but we also
documented that it shouldn't change per connection and therefore can
be cached. It's not hard to see that we have to consult the size per
connection (see commit b3a43ccd for a test that purposefully exposes
different sizes to separate clients), nor to search the code to see we
already cache it at the protocol
2020 Jul 14
3
[PATCH nbdkit RFC 0/2] curl: Implement authorization scripts.
This is an RFC only, at the very least it lacks tests.
This implements a rather complex new feature in nbdkit-curl-plugin
allowing you to specify an external shell script that can be used to
fetch an authorization token for services which requires a token or
cookie for access, especially if that token must be renewed
periodically. The motivation can be seen in the changes to the docs
in patch 2.
2019 Sep 24
2
[PATCH libnbd] lib: Copy nbd-protocol.h from nbdkit 1.15.3.
Eventually nbdkit will install this as a public header file and we
will be able to consume it from $includedir. In the mean time
synchronize with the copy in nbdkit.
---
lib/nbd-protocol.h | 57 +++++++++++++++++++++++-----------------------
1 file changed, 28 insertions(+), 29 deletions(-)
diff --git a/lib/nbd-protocol.h b/lib/nbd-protocol.h
index 699aa22..7df411a 100644
---
2020 Jul 21
4
[PATCH nbdkit] server: Pass the export name through filter .open calls.
To allow filters to modify the export name as it passes through the
layers this commit makes several changes:
The filter .open callback now takes an extra parameter, the export
name. This is always non-NULL (for oldstyle it is ""). This string
has a short lifetime and filters that need to hang on to it must take
a copy. The filter must pass the exportname parameter down to the
next
2019 Mar 18
3
[PATCH nbdkit 0/2] server: Split out NBD protocol code from connections code.
These are a couple of patches in preparation for the Block Status
implementation. While the patches (especially the second one) are
very large they are really just elementary code motion.
Rich.
2020 May 19
1
[PATCH nbdkit] common/include: Add locale-safe ascii_strcasecmp and ascii_strncasecmp.
These are derived from the FreeBSD functions here:
https://github.com/freebsd/freebsd/blob/master/sys/libkern/strcasecmp.c
Thanks: Eric Blake.
---
common/include/Makefile.am | 6 +++
common/include/ascii-ctype.h | 6 +++
common/include/ascii-string.h | 77 ++++++++++++++++++++++++++++
common/include/test-ascii-string.c | 79 +++++++++++++++++++++++++++++
server/main.c
2019 Sep 19
1
[PATCH nbdkit] server: Remove tricksy initialization of struct b_conn_handle.
b_conn_handle fields exportsize and can_* have a special meaning when
they are -1. It means that the value of the field has not been
computed and cached yet.
The struct was being initialized using memset (_, -1, _) which does
indeed have the effect of setting all the fields to -1, although it's
somewhat non-obvious to say the least.
This commit replaces it with ordinary field