aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-07-18 11:02:36 -0400
committerNick Mathewson <nickm@torproject.org>2013-07-18 11:23:45 -0400
commitae641971955f5ff4969a57cd7a011f41eb303bb4 (patch)
treea763818ebb00e415d5231c20fded5e52c48016a6 /src/or
parent1047e7dcb05cbf4c98276d00c157cf0506b451d5 (diff)
downloadtor-ae641971955f5ff4969a57cd7a011f41eb303bb4.tar
tor-ae641971955f5ff4969a57cd7a011f41eb303bb4.tar.gz
Unit tests for cell queues.
This removes some INLINE markers from functions that probably didn't need them.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/relay.c6
-rw-r--r--src/or/relay.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 81132a131..297f0f69e 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2089,7 +2089,7 @@ packed_cell_free_unchecked(packed_cell_t *cell)
}
/** Allocate and return a new packed_cell_t. */
-static INLINE packed_cell_t *
+STATIC packed_cell_t *
packed_cell_new(void)
{
++total_cells_allocated;
@@ -2100,6 +2100,8 @@ packed_cell_new(void)
void
packed_cell_free(packed_cell_t *cell)
{
+ if (!cell)
+ return;
packed_cell_free_unchecked(cell);
}
@@ -2210,7 +2212,7 @@ cell_queue_clear(cell_queue_t *queue)
/** Extract and return the cell at the head of <b>queue</b>; return NULL if
* <b>queue</b> is empty. */
-static INLINE packed_cell_t *
+STATIC packed_cell_t *
cell_queue_pop(cell_queue_t *queue)
{
packed_cell_t *cell = TOR_SIMPLEQ_FIRST(&queue->head);
diff --git a/src/or/relay.h b/src/or/relay.h
index 59e107b2a..e1b5e381e 100644
--- a/src/or/relay.h
+++ b/src/or/relay.h
@@ -82,6 +82,8 @@ int relay_crypt(circuit_t *circ, cell_t *cell, cell_direction_t cell_direction,
#ifdef RELAY_PRIVATE
STATIC int connected_cell_parse(const relay_header_t *rh, const cell_t *cell,
tor_addr_t *addr_out, int *ttl_out);
+STATIC packed_cell_t *packed_cell_new(void);
+STATIC packed_cell_t *cell_queue_pop(cell_queue_t *queue);
#endif
#endif