From 0b43d32e460ec10b89fe19202945771fb90b6188 Mon Sep 17 00:00:00 2001 From: Bradford Hovinen Date: Wed, 20 Jun 2001 14:41:18 +0000 Subject: [PATCH] Don't apprise slave of new data (config_log_write_entry): Dump log after 2001-06-20 Bradford Hovinen * config-log.c (slave_new): Don't apprise slave of new data (config_log_write_entry): Dump log after every write --- archiver/ChangeLog | 5 +++++ archiver/config-log.c | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/archiver/ChangeLog b/archiver/ChangeLog index 7a3571153..66b6fa5a9 100644 --- a/archiver/ChangeLog +++ b/archiver/ChangeLog @@ -1,3 +1,8 @@ +2001-06-20 Bradford Hovinen + + * config-log.c (slave_new): Don't apprise slave of new data + (config_log_write_entry): Dump log after every write + 2001-06-19 Bradford Hovinen * archive.c (archive_set_current_location): Free the location path diff --git a/archiver/config-log.c b/archiver/config-log.c index 8ea85bc29..09874bd71 100644 --- a/archiver/config-log.c +++ b/archiver/config-log.c @@ -529,10 +529,12 @@ config_log_write_entry (ConfigLog *config_log, gchar *backend_id, config_log->p->log_data = g_list_prepend (config_log->p->log_data, entry); - if (config_log->p->socket_owner) + if (config_log->p->socket_owner) { slave_broadcast_data (NULL, config_log); - else + dump_log (config_log); + } else { write_log (config_log->p->socket_buffer, entry); + } return entry->id; } @@ -997,7 +999,7 @@ write_log (IOBuffer *output, ConfigLogEntry *entry) entry->date->tm_mon + 1, entry->date->tm_mday, entry->date->tm_hour, entry->date->tm_min, entry->date->tm_sec, entry->backend_id); - DEBUG_MSG ("Writing %s", str); + DEBUG_MSG ("Writing %s, from_socket = %d", str, output->from_socket); io_buffer_write (output, str); g_free (str); } @@ -1306,8 +1308,6 @@ slave_new (ConfigLog *config_log, int fd) (GIOFunc) slave_data_cb, slave); - slave_apprise_data (slave); - return slave; } @@ -1337,6 +1337,7 @@ slave_data_cb (GIOChannel *channel, GIOCondition condition, DEBUG_MSG ("Condition is %d", condition); if (condition & G_IO_HUP || slave->buffer->closed) { + DEBUG_MSG ("Removing slave"); slave_destroy (slave); return FALSE; } @@ -1361,6 +1362,8 @@ slave_broadcast_data (Slave *slave, ConfigLog *config_log) Slave *current; ConfigLogEntry *first_entry; + DEBUG_MSG ("Enter"); + first_entry = config_log->p->log_data->data; for (node = config_log->p->slaves; node != NULL; node = node->next) { @@ -1369,6 +1372,8 @@ slave_broadcast_data (Slave *slave, ConfigLog *config_log) if (current == slave) continue; write_log (current->buffer, first_entry); } + + DEBUG_MSG ("Exit"); } /* Sends all the new log entries to the given slave */