aboutsummaryrefslogtreecommitdiff
path: root/src/feature/dircache/dircache_stub.c
blob: 87811597d1726b71a5cf1f91546573561078f4d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/* Copyright (c) 2001-2004, Roger Dingledine.
 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
 * Copyright (c) 2007-2020, The Tor Project, Inc. */
/* See LICENSE for licensing information */

/**
 * @file dircache_stub.c
 * @brief Stub declarations for use when dircache module is disabled.
 **/

#include "core/or/or.h"
#include "feature/dircache/consdiffmgr.h"
#include "feature/dircache/dircache.h"
#include "feature/dircache/dirserv.h"
#include "feature/dircommon/dir_connection_st.h"

int
directory_handle_command(dir_connection_t *conn)
{
  (void) conn;
  tor_assert_nonfatal_unreached_once();
  return -1;
}

int
connection_dirserv_flushed_some(dir_connection_t *conn)
{
  (void) conn;
  tor_assert_nonfatal_unreached_once();
  return -1;
}

void
dir_conn_clear_spool(dir_connection_t *conn)
{
  if (!conn)
    return;
  tor_assert_nonfatal_once(conn->spool == NULL);
}

void
consdiffmgr_enable_background_compression(void)
{
}

int
consdiffmgr_add_consensus(const char *consensus,
                          size_t consensus_len,
                          const networkstatus_t *as_parsed)
{
  (void)consensus;
  (void)consensus_len;
  (void)as_parsed;
  return 0;
}

int
consdiffmgr_register_with_sandbox(struct sandbox_cfg_elem_t **cfg)
{
  (void)cfg;
  return 0;
}

int
consdiffmgr_cleanup(void)
{
  return 0;
}

void
consdiffmgr_free_all(void)
{
}

void
dirserv_free_all(void)
{
}