Displaying 20 results from an estimated 25 matches for "log_open".
2020 Jul 22
1
Re: [PATCH nbdkit] server: Pass the export name through filter .open calls.
...nt
backend.c to start storing the name passed into backend_open().
>
>> +++ b/filters/log/log.c
>> @@ -227,11 +227,12 @@ output_return (struct handle *h, const char
>> *act, uint64_t id, int r, int *err)
>> /* Open a connection. */
>> static void *
>> -log_open (nbdkit_next_open *next, void *nxdata, int readonly)
>> +log_open (nbdkit_next_open *next, void *nxdata,
>> + int readonly, const char *exportname)
>> {
>> struct handle *h;
>> - if (next (nxdata, readonly) == -1)
>> + if (next (nxdata, readonly,...
2003 Nov 17
1
rsync --daemon and logfile that can't be created
...ere'a a proposed patch to fallback to syslog if opening the log file
fails:
--- ../cvstree/rsync/log.c 2003-03-25 03:28:54.000000000 +0100
+++ ./log.c 2003-11-17 13:31:15.000000000 +0100
@@ -134,9 +134,9 @@
static void logit(int priority, char *buf)
{
- if (logfname) {
- if (!logfile)
- log_open();
+ if (logfname && !logfile)
+ log_open();
+ if (logfile) {
fprintf(logfile,"%s [%d] %s",
timestring(time(NULL)), (int)getpid(), buf);
fflush(logfile);
@@ -164,9 +164,11 @@
if (logfname) {
if (*logfname) {
log_open();
- return;
+ if...
2005 Mar 15
0
[Bug 2455] New: rsync --daemon segfaults if "log file = <file>" dir does not exist
...},
{ RERR_CMD_KILLED , "remote shell killed" },
{ RERR_CMD_RUN, "remote command could not be run" },
***************
*** 89,96 ****
static void logit(int priority, char *buf)
{
if (logfname) {
! if (!logfile)
log_open();
fprintf(logfile,"%s [%d] %s",
timestring(time(NULL)), (int)getpid(), buf);
fflush(logfile);
--- 90,103 ----
static void logit(int priority, char *buf)
{
if (logfname) {
! if (!logfile) /* Try opening...
2002 Dec 23
3
rsync 2.5.5 SCO Unixware patch
....c Mon Dec 23 21:51:43 2002
@@ -1177,7 +1177,7 @@
/*
* allocate a new file list
*/
-struct file_list *flist_new()
+struct file_list *flist_new(void)
{
struct file_list *flist;
--- log.c.orig Mon Dec 23 21:51:47 2002
+++ log.c Mon Dec 23 21:51:54 2002
@@ -183,7 +183,7 @@
#endif
}
-void log_open()
+void log_open(void)
{
if (logfname && !logfile) {
extern int orig_umask;
@@ -193,7 +193,7 @@
}
}
-void log_close()
+void log_close(void)
{
if (logfile) {
fclose(logfile);
--- popt/popt.c.orig Mon Dec 23 21:51:59 2002
+++ popt/popt.c Mon Dec 23 21:59:21 2002
@@ -443,9 +44...
2003 Mar 05
0
"rsync --daemon" and IPv4/v6 dual stack
...so this ensures that they are reaped */
#ifdef WNOHANG
- while (waitpid(-1, NULL, WNOHANG) > 0);
+ while (waitpid(-1, NULL, WNOHANG) > 0);
#endif
- if ((pid = fork()) == 0) {
- close(s);
- /* open log file in child before possibly giving
- up privileges */
- log_open();
- _exit(fn(fd));
- } else if (pid < 0) {
- rprintf(FERROR,
- RSYNC_NAME
- ": could not create child server process: %s\n",
- strerror(errno));
- close(fd);
- /* This might have happened because we're
- * overloaded. Sleep briefly before trying to
- * acc...
2020 Jul 22
0
Re: [PATCH nbdkit] server: Pass the export name through filter .open calls.
...like
protocol-handshake.c is the only caller, and still has everything in
scope at the time.
> +++ b/filters/log/log.c
> @@ -227,11 +227,12 @@ output_return (struct handle *h, const char *act, uint64_t id, int r, int *err)
>
> /* Open a connection. */
> static void *
> -log_open (nbdkit_next_open *next, void *nxdata, int readonly)
> +log_open (nbdkit_next_open *next, void *nxdata,
> + int readonly, const char *exportname)
> {
> struct handle *h;
>
> - if (next (nxdata, readonly) == -1)
> + if (next (nxdata, readonly, exportname) ==...
2004 Jan 13
3
Progress reporting: N more to check
...stions?
..wayne..
-------------- next part --------------
--- log.c 13 Jan 2004 04:50:45 -0000 1.69
+++ log.c 13 Jan 2004 04:51:01 -0000
@@ -191,6 +191,8 @@ void log_init(void)
#ifndef LOG_NDELAY
logit(LOG_INFO,"rsyncd started\n");
#endif
+
+ stats.current_file_index = -1;
}
void log_open(void)
--- progress.c 13 Jan 2004 05:13:57 -0000 1.5
+++ progress.c 13 Jan 2004 05:00:29 -0000
@@ -21,6 +21,7 @@
#include "rsync.h"
+extern struct stats stats;
extern int am_server;
static OFF_T last_ofs;
@@ -45,6 +46,7 @@ static unsigned long msdiff(struct timev
static void rpr...
2020 Jul 21
4
[PATCH nbdkit] server: Pass the export name through filter .open calls.
...ENT_SCOPE (&lock);
diff --git a/filters/log/log.c b/filters/log/log.c
index f47a6a93..8b146f1c 100644
--- a/filters/log/log.c
+++ b/filters/log/log.c
@@ -227,11 +227,12 @@ output_return (struct handle *h, const char *act, uint64_t id, int r, int *err)
/* Open a connection. */
static void *
-log_open (nbdkit_next_open *next, void *nxdata, int readonly)
+log_open (nbdkit_next_open *next, void *nxdata,
+ int readonly, const char *exportname)
{
struct handle *h;
- if (next (nxdata, readonly) == -1)
+ if (next (nxdata, readonly, exportname) == -1)
return NULL;
h = malloc...
2020 Aug 25
0
[nbdkit PATCH 3/5] api: Add nbdkit_string_intern helper
...3c4a15 100644
--- a/filters/log/log.c
+++ b/filters/log/log.c
@@ -134,7 +134,7 @@ log_get_ready (nbdkit_next_get_ready *next, void *nxdata, int thread_model)
struct handle {
uint64_t connection;
uint64_t id;
- char *exportname;
+ const char *exportname;
int tls;
};
@@ -305,9 +305,8 @@ log_open (nbdkit_next_open *next, void *nxdata,
* it in log_prepare. We must take a copy because this string has a
* short lifetime.
*/
- h->exportname = strdup (exportname);
+ h->exportname = nbdkit_string_intern (exportname);
if (h->exportname == NULL) {
- nbdkit_error ("...
2020 Aug 27
0
[nbdkit PATCH v2 4/8] api: Add nbdkit_str[n]dup_intern helper
...25f362 100644
--- a/filters/log/log.c
+++ b/filters/log/log.c
@@ -134,7 +134,7 @@ log_get_ready (nbdkit_next_get_ready *next, void *nxdata, int thread_model)
struct handle {
uint64_t connection;
uint64_t id;
- char *exportname;
+ const char *exportname;
int tls;
};
@@ -305,9 +305,8 @@ log_open (nbdkit_next_open *next, void *nxdata,
* it in log_prepare. We must take a copy because this string has a
* short lifetime.
*/
- h->exportname = strdup (exportname);
+ h->exportname = nbdkit_strdup_intern (exportname);
if (h->exportname == NULL) {
- nbdkit_error ("...
2020 Aug 07
0
[nbdkit PATCH 1/3] server: Implement nbdkit_is_tls for use during .open
...@ -135,6 +135,7 @@ struct handle {
uint64_t connection;
uint64_t id;
char *exportname;
+ int tls;
};
/* Compute the next id number on the current connection. */
@@ -283,7 +284,7 @@ log_list_exports (nbdkit_next_list_exports *next, void *nxdata,
/* Open a connection. */
static void *
log_open (nbdkit_next_open *next, void *nxdata,
- int readonly, const char *exportname)
+ int readonly, const char *exportname, int is_tls)
{
struct handle *h;
@@ -296,9 +297,9 @@ log_open (nbdkit_next_open *next, void *nxdata,
return NULL;
}
- /* Save the exportname in the...
2002 Aug 22
1
Applying the "Connection reset by peer"
Hi all,
we're suffering heavily from the "connection reset by peer" problem when
running Rsync on WinNT.
Great was our relief when seeing Randy's message in
http://www.mail-archive.com/rsync@lists.samba.org/msg01918.html
I immediately installed the full Cygwin to recompile Rsync, but since I'm
far from a C guru, I'm a bit puzzled with the last 2 lines in Randy's
2018 Jan 28
0
[nbdkit PATCH 2/2] filters: Add log filter
...C:
+ s = "ENOSPC";
+ break;
+#ifdef ESHUTDOWN
+ case ESHUTDOWN:
+ s = "ESHUTDOWN";
+ break;
+#endif
+ case EINVAL:
+ s = "EINVAL";
+ break;
+ }
+ output (h, act, id, "return=%d (%s)", r, s);
+}
+
+/* Open a connection. */
+static void *
+log_open (nbdkit_next_open *next, void *nxdata, int readonly)
+{
+ struct handle *h;
+
+ if (next (nxdata, readonly) == -1)
+ return NULL;
+
+ h = malloc (sizeof *h);
+ if (h == NULL) {
+ nbdkit_error ("malloc: %m");
+ return NULL;
+ }
+
+ pthread_mutex_lock (&lock);
+ h->co...
2019 Apr 24
0
[nbdkit PATCH 4/4] filters: Check for mutex failures
...&lock);
+ rand = xrandom (&random_state) & UINT32_MAX;
+ }
if (rand >= error_settings->rate * UINT32_MAX)
return false;
diff --git a/filters/log/log.c b/filters/log/log.c
index 63afcf3..76af98b 100644
--- a/filters/log/log.c
+++ b/filters/log/log.c
@@ -217,9 +217,8 @@ log_open (nbdkit_next_open *next, void *nxdata, int readonly)
return NULL;
}
- pthread_mutex_lock (&lock);
+ ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&lock);
h->connection = ++connections;
- pthread_mutex_unlock (&lock);
h->id = 0;
return h;
}
diff --git a/filters/rate/rate.c...
2003 Jun 07
1
patch to rsync to add options for pre- and post-transfer commands
...27 11:34:53.000000000 -0600
***************
*** 151,156 ****
--- 151,158 ----
BOOL lp_load(char *pszFname, int globals_only);
int lp_numservices(void);
int lp_number(char *name);
+ char *lp_prescript(int );
+ char *lp_postscript(int );
void err_list_push(void);
void log_init(void);
void log_open(void);
Only in rsync-2.5.6: rsync
Only in rsync-2.5.6: rsync_script.patch
Only in rsync-2.5.6: shconfig
diff --exclude='*.o' -b --context rsync-2.5.6.orig/socket.c rsync-2.5.6/socket.c
*** rsync-2.5.6.orig/socket.c 2003-01-26 20:35:09.000000000 -0700
--- rsync-2.5.6/socket.c 2003-05-19 14:2...
2003 Apr 15
0
Patch for stderr logging
...bals.socket_options)
FN_GLOBAL_INTEGER(lp_syslog_facility, &Globals.syslog_facility)
diff -Nuar rsync-2.5.6/log.c rsync-2.5.6.new/log.c
--- rsync-2.5.6/log.c Mon Dec 23 23:42:04 2002
+++ rsync-2.5.6.new/log.c Sat Apr 12 23:57:54 2003
@@ -137,11 +137,17 @@
if (logfname) {
if (!logfile)
log_open();
- fprintf(logfile,"%s [%d] %s",
- timestring(time(NULL)), (int)getpid(), buf);
+ if (lp_log_timestamp()) {
+ fprintf(logfile,"%s ", timestring(time(NULL)));
+ }
+ if (lp_log_pid()) {
+ fprintf(logfile,"[%d] ", (int)getpid());
+ }
+ fprintf(logfile,"...
2020 Aug 07
7
[nbdkit PATCH 0/3] Content differentiation during --tls=on
Patch 3 still needs tests added, but it is at least working from
my simple command line tests.
Eric Blake (3):
server: Implement nbdkit_is_tls for use during .open
server: Expose final thread_model to filter's .get_ready
tlsdummy: New filter
docs/nbdkit-filter.pod | 21 +-
docs/nbdkit-plugin.pod | 34 ++-
docs/nbdkit-tls.pod
2019 Apr 24
7
[nbdkit PATCH 0/4] More mutex sanity checking
I do have a question about whether patch 2 is right, or whether I've
exposed a bigger problem in the truncate (and possibly other) filter,
but the rest seem fairly straightforward.
Eric Blake (4):
server: Check for pthread lock failures
truncate: Factor out reading real_size under mutex
plugins: Check for mutex failures
filters: Check for mutex failures
filters/cache/cache.c
2018 Jan 28
3
[nbdkit PATCH 0/2] RFC: tweak error handling, add log filter
Here's what I'm currently playing with; I'm not ready to commit
anything until I rebase my FUA work on top of this, as I only
want to break filter ABI once between releases.
Eric Blake (2):
backend: Rework internal/filter error return semantics
filters: Add log filter
TODO | 2 -
docs/nbdkit-filter.pod | 84 +++++++--
docs/nbdkit.pod
2020 Aug 06
6
[nbdkit PATCH v2 0/5] .list_exports
Since v1:
- patch 1: check size limits
- patch 2: better handling of default export name canonicalization
- patch 3: support filters as well as plugins
- patch 4: new
- patch 5: rewrite sh parser, fix testsuite to actually work and
cover more cases (now that libnbd.git is fixed)
Eric Blake (4):
server: Add exports list functions
server: Prepare to use export list from plugin
log: Add