Displaying 20 results from an estimated 32 matches for "write_cb".
2016 Nov 09
1
[PATCH] upload: improve file write callback
...aemon/upload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/upload.c b/daemon/upload.c
index f034627..8b4f600 100644
--- a/daemon/upload.c
+++ b/daemon/upload.c
@@ -84,7 +84,7 @@ upload (const char *filename, int flags, int64_t offset)
}
}
- r = receive_file (write_cb, &data.fd);
+ r = receive_file (write_cb, &data);
if (r == -1) { /* write error */
err = errno;
r = cancel_receive ();
--
2.10.2
2016 Dec 14
0
[PATCH] daemon: expose file upload logic
...these to indicate errors
* NB: you don't need to prefix the string with the current command,
* it is added automatically by the client-side RPC stubs.
diff --git a/daemon/upload.c b/daemon/upload.c
index 8b4f600..0f385b6 100644
--- a/daemon/upload.c
+++ b/daemon/upload.c
@@ -54,60 +54,68 @@ write_cb (void *data_vp, const void *buf, size_t len)
return 0;
}
+int
+upload_to_fd (int fd)
+{
+ int ret = 0, err = 0;
+ struct write_cb_data data = { .fd = fd, .written = 0 };
+
+ ret = receive_file (write_cb, &data);
+ if (ret == -1) { /* write error */
+ err = errno;
+ ret = cancel_...
2017 Mar 12
0
[PATCH v4 1/7] daemon: expose file upload logic
...e to indicate errors
* NB: you don't need to prefix the string with the current command,
* it is added automatically by the client-side RPC stubs.
diff --git a/daemon/upload.c b/daemon/upload.c
index 655baf29d..144bb246c 100644
--- a/daemon/upload.c
+++ b/daemon/upload.c
@@ -54,60 +54,68 @@ write_cb (void *data_vp, const void *buf, size_t len)
return 0;
}
+int
+upload_to_fd (int fd)
+{
+ int ret = 0, err = 0;
+ struct write_cb_data data = { .fd = fd, .written = 0 };
+
+ ret = receive_file (write_cb, &data);
+ if (ret == -1) { /* write error */
+ err = errno;
+ ret = cancel_...
2017 Apr 06
0
[PATCH v6 1/7] daemon: expose file upload logic
...e to indicate errors
* NB: you don't need to prefix the string with the current command,
* it is added automatically by the client-side RPC stubs.
diff --git a/daemon/upload.c b/daemon/upload.c
index 655baf29d..144bb246c 100644
--- a/daemon/upload.c
+++ b/daemon/upload.c
@@ -54,60 +54,68 @@ write_cb (void *data_vp, const void *buf, size_t len)
return 0;
}
+int
+upload_to_fd (int fd)
+{
+ int ret = 0, err = 0;
+ struct write_cb_data data = { .fd = fd, .written = 0 };
+
+ ret = receive_file (write_cb, &data);
+ if (ret == -1) { /* write error */
+ err = errno;
+ ret = cancel_...
2017 Apr 23
0
[PATCH v7 1/7] daemon: expose file upload logic
...e to indicate errors
* NB: you don't need to prefix the string with the current command,
* it is added automatically by the client-side RPC stubs.
diff --git a/daemon/upload.c b/daemon/upload.c
index 655baf29d..1b109e634 100644
--- a/daemon/upload.c
+++ b/daemon/upload.c
@@ -54,19 +54,50 @@ write_cb (void *data_vp, const void *buf, size_t len)
return 0;
}
+int
+upload_to_fd (int fd, const char *filename)
+{
+ int r = 0, err = 0;
+ struct write_cb_data data = { .fd = fd, .written = 0 };
+
+ r = receive_file (write_cb, &data);
+ if (r == -1) { /* write error */
+ err = errno;
+...
2016 Dec 14
2
[PATCH] daemon: expose file upload logic
Exposing file upload logic as suggested in previous patch:
https://www.redhat.com/archives/libguestfs/2016-November/msg00109.html
Matteo Cafasso (1):
daemon: expose upload logic
daemon/daemon.h | 3 +++
daemon/upload.c | 70 ++++++++++++++++++++++++++++++++-------------------------
2 files changed, 42 insertions(+), 31 deletions(-)
--
2.10.2
2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
...e "array-size.h"
#include "ascii-ctype.h"
#include "ascii-string.h"
#include "cleanup.h"
@@ -73,6 +74,18 @@ static int debug_cb (CURL *handle, curl_infotype type,
static size_t header_cb (void *ptr, size_t size, size_t nmemb, void *opaque);
static size_t write_cb (char *ptr, size_t size, size_t nmemb, void *opaque);
static size_t read_cb (void *ptr, size_t size, size_t nmemb, void *opaque);
+static void lock_cb (CURL *handle, curl_lock_data data,
+ curl_lock_access access, void *userptr);
+static void unlock_cb (CURL *handle, curl_lock_...
2017 Apr 06
14
[PATCH v6 0/7] Feature: Yara file scanning
v6:
- use new test functions
- fix yara_detection struct field names
- revert yara_load function to initial version
With Pino we were exploring the idea of allowing Users to load multiple
rule files with subsequent calls to yara_load API.
https://www.redhat.com/archives/libguestfs/2016-November/msg00119.html
It turns out impractical due to YARA API limitations. It is possible
to load multiple
2023 Feb 22
2
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
I'm mainly posting this to the list as a back-up. It does work, it
does _not_ improve performance in any noticable way. However I'm
having lots of trouble getting HTTP/2 to work (with or without this
patch) and that's stopping me from testing anything properly.
Rich.
2017 Apr 24
10
[PATCH v8 0/8] Feature: Yara file scanning
v8:
- Ignore returned value in daemon/upload.c
- Report serialization errors in lib/yara.c
Matteo Cafasso (8):
daemon: ignore unused return value in upload function
daemon: expose file upload logic
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
appliance/packagelist.in
2015 Jul 15
1
[PATCH 1/2] actions: tar_out: add xattrs and selinux optargs
Add additional arguments for tar, so extended attributes and/or SELinux
contexts can be saved in output tars.
---
daemon/tar.c | 18 +++++++++++++-----
generator/actions.ml | 10 +++++++++-
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/daemon/tar.c b/daemon/tar.c
index d6f8f2f..68af749 100644
--- a/daemon/tar.c
+++ b/daemon/tar.c
@@ -311,7 +311,7 @@
2023 Feb 22
1
[PATCH nbdkit] curl: Try to share as much as possible between handles in the pool
...; #include "ascii-ctype.h"
> #include "ascii-string.h"
> #include "cleanup.h"
> @@ -73,6 +74,18 @@ static int debug_cb (CURL *handle, curl_infotype type,
> static size_t header_cb (void *ptr, size_t size, size_t nmemb, void *opaque);
> static size_t write_cb (char *ptr, size_t size, size_t nmemb, void *opaque);
> static size_t read_cb (void *ptr, size_t size, size_t nmemb, void *opaque);
> +static void lock_cb (CURL *handle, curl_lock_data data,
> + curl_lock_access access, void *userptr);
> +static void unlock_cb (CURL...
2017 Feb 19
9
[PATCH v3 0/7] Feature: Yara file scanning
Rebase patches on top of 1.35.25.
No changes since last series.
Matteo Cafasso (7):
daemon: expose file upload logic
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
appliance/packagelist.in | 4 +
configure.ac | 1 +
daemon/Makefile.am
2020 Jul 14
0
[PATCH nbdkit RFC 2/2] curl: Implement authorization scripts.
...(h);
}
@@ -638,6 +651,10 @@ curl_pread (void *handle, void *buf, uint32_t count, uint64_t offset)
CURLcode r;
char range[128];
+ /* Run the auth-script if necessary and set headers in the handle. */
+ if (auth_script && do_auth_script (h) == -1)
+ return -1;
+
/* Tell the write_cb where we want the data to be written. write_cb
* will update this if the data comes in multiple sections.
*/
@@ -699,6 +716,10 @@ curl_pwrite (void *handle, const void *buf, uint32_t count, uint64_t offset)
CURLcode r;
char range[128];
+ /* Run the auth-script if necessary and set...
2017 Apr 25
8
[PATCH v9 0/7] Feature: Yara file scanning
v9:
- fixes according to comments
Matteo Cafasso (7):
daemon: expose file upload logic
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
appliance/packagelist.in | 4 +
configure.ac | 1 +
daemon/Makefile.am | 4 +-
2017 Mar 12
8
[PATCH v4 0/7] Feature: Yara file scanning
Rebase patches on top of 1.37.1.
No changes since last series.
Matteo Cafasso (7):
daemon: expose file upload logic
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
appliance/packagelist.in | 4 +
configure.ac | 1 +
daemon/Makefile.am
2012 Feb 27
4
[PATCH 0/4] Add various ntfs* tools and unify label setting.
This miscellaneous patch adds bindings for:
- ntfsfix
- ntfsclone
- ntfslabel
and unifies filesystem label setting through a single API 'set-label'
which replaces 'set-e2label' and is also able to set labels on NTFS
using the ntfslabel program.
'ntfsfix' has been added as a possible way to fix RHBZ#797760.
However I have not found a way to fully fix this bug. See
2017 Apr 04
13
[PATCH v5 0/7] Feature: Yara file scanning
v5:
- rebase on top of 1.37.9
- add missing actions_yara.* files
Matteo Cafasso (7):
daemon: expose file upload logic
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
appliance/packagelist.in | 4 +
configure.ac | 1 +
daemon/Makefile.am
2017 Apr 23
11
[PATCH v7 0/7] Feature: Yara file scanning
v7:
- Fixes according to comments
- Rebase on top of 1.37.12
Matteo Cafasso (7):
daemon: expose file upload logic
appliance: add yara dependency
New API: yara_load
New API: yara_destroy
New API: internal_yara_scan
New API: yara_scan
yara_scan: added API tests
appliance/packagelist.in | 4 +
configure.ac | 1 +
daemon/Makefile.am
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.