Пример #1
0
static gboolean
_setup_auth_header(LogPipe *s)
{
  HTTPDestinationDriver *self = (HTTPDestinationDriver *)s;
  GlobalConfig *cfg = log_pipe_get_config(s);

  HttpAuthHeader *prev_auth_header = cfg_persist_config_fetch(cfg, _format_auth_header_name(s));

  if (prev_auth_header)
    {
      http_auth_header_free(self->auth_header);
      self->auth_header = prev_auth_header;
      msg_debug("Auth header instance found in persist cfg",
                log_pipe_location_tag(s));
      return TRUE;
    }

  if (self->auth_header)
    {
      if (!http_auth_header_init(self->auth_header))
        {
          return FALSE;
        }
      _load_auth_header(s);
    }

  return TRUE;
}
Пример #2
0
static gboolean
_init(LogPipe *s)
{
  ThreadedDiskqSourceDriver *self = (ThreadedDiskqSourceDriver *) s;

  if (!self->filename)
    {
      msg_error("The file() option for diskq-source() is mandatory", log_pipe_location_tag(s));
      return FALSE;
    }

  return log_threaded_fetcher_driver_init_method(s);
}
Пример #3
0
static void
_load_auth_header(LogPipe *s)
{
  HTTPDestinationDriver *self = (HTTPDestinationDriver *)s;

  if (_load_auth_header_from_persist_file(s))
    return;

  if (!_auth_header_renew(self))
    {
      msg_warning("WARNING: http() driver failed to get auth header",
                  log_pipe_location_tag(s));
    }
}