Displaying 6 results from an estimated 6 matches for "free_threadlocal".
2017 Nov 17
0
[nbdkit PATCH 2/4] threadlocal: Copy thread name
...and binary forms, with or without
@@ -55,7 +55,7 @@
*/
struct threadlocal {
- const char *name; /* Can be NULL. */
+ char *name; /* Can be NULL. */
size_t instance_num; /* Can be 0. */
struct sockaddr *addr;
socklen_t addrlen;
@@ -69,6 +69,7 @@ free_threadlocal (void *threadlocalv)
{
struct threadlocal *threadlocal = threadlocalv;
+ free (threadlocal->name);
free (threadlocal->addr);
free (threadlocal);
}
@@ -104,8 +105,16 @@ threadlocal_set_name (const char *name)
{
struct threadlocal *threadlocal = pthread_getspecific (threadlocal...
2019 Sep 18
1
[PATCH nbdkit] server: Remove useless thread local sockaddr.
...threadlocal.c
+++ b/server/threadlocal.c
@@ -55,8 +55,6 @@
struct threadlocal {
char *name; /* Can be NULL. */
size_t instance_num; /* Can be 0. */
- struct sockaddr *addr;
- socklen_t addrlen;
int err;
void *buffer;
size_t buffer_size;
@@ -71,7 +69,6 @@ free_threadlocal (void *threadlocalv)
struct threadlocal *threadlocal = threadlocalv;
free (threadlocal->name);
- free (threadlocal->addr);
free (threadlocal->buffer);
free (threadlocal);
}
@@ -133,22 +130,6 @@ threadlocal_set_instance_num (size_t instance_num)
threadlocal->instance...
2019 Apr 23
0
[PATCH nbdkit v2 2/2] server: Use a thread-local pread/pwrite buffer to avoid leaking heap data.
...threadlocal.c
index e556dbc..49ae1ac 100644
--- a/server/threadlocal.c
+++ b/server/threadlocal.c
@@ -58,6 +58,8 @@ struct threadlocal {
struct sockaddr *addr;
socklen_t addrlen;
int err;
+ void *buffer;
+ size_t buffer_size;
};
static pthread_key_t threadlocal_key;
@@ -69,6 +71,7 @@ free_threadlocal (void *threadlocalv)
free (threadlocal->name);
free (threadlocal->addr);
+ free (threadlocal->buffer);
free (threadlocal);
}
@@ -189,3 +192,37 @@ threadlocal_get_error (void)
errno = err;
return threadlocal ? threadlocal->err : 0;
}
+
+/* Return the single pread/pw...
2017 Nov 17
7
[nbdkit PATCH 0/4] thread-safety issues prior to parallel handling
These patches should be ready to go in now; I will also post my
work-in-progress for enabling full parallel handling that depends
on these, but with that series, I was still getting crashes or
hangs with test-socket-activation (I think I've nailed all the
crashes I've seen, but the hang is rather insidious; see my other
email
2017 Nov 14
7
[PATCH 0/3] Alternate way to avoid race conditions when nbdkit exits.
This fixes the race conditions for me, using the test described here:
https://www.redhat.com/archives/libguestfs/2017-September/msg00226.html
Rich.
2019 Apr 23
4
[PATCH nbdkit v2 0/2] Be careful not to leak server heap memory to the client.
Version 1 was here:
https://www.redhat.com/archives/libguestfs/2019-April/msg00144.html
Version 2 makes a couple of much larger changes:
The OCaml patch changes the API of the pread method so it matches what
other language bindings are already doing, ie. get the language plugin
to return a newly allocated buffer, check it is long enough, copy out
the data.
The server patch implements a