Skip to content

Commit d585858

Browse files
Cleanup
1 parent 424d207 commit d585858

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/agent.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,12 @@ struct juice_agent {
144144
timestamp_t nomination_timestamp;
145145
bool gathering_done;
146146

147+
conn_registry_t *registry;
147148
int conn_index;
148149
void *conn_impl;
149150

150151
thread_t resolver_thread;
151152
bool resolver_thread_started;
152-
153-
conn_registry_t *registry;
154153
};
155154

156155
juice_agent_t *agent_create(const juice_config_t *config);

src/conn.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
#include <assert.h>
1717
#include <string.h>
18-
#include <stdio.h>
1918

2019
#define INITIAL_REGISTRY_SIZE 16
2120

@@ -37,14 +36,14 @@ static conn_mode_entry_t mode_entries[MODE_ENTRIES_SIZE] = {
3736

3837
static conn_mode_entry_t mode_entries[MODE_ENTRIES_SIZE];
3938

40-
conn_mode_entry_t *conn_get_mode_entry(juice_concurrency_mode_t mode) {
39+
conn_mode_entry_t *get_mode_entry(juice_concurrency_mode_t mode) {
4140
assert(mode >= 0 && mode < MODE_ENTRIES_SIZE);
4241
return mode_entries + (int)mode;
4342
}
4443

4544
static conn_mode_entry_t *get_agent_mode_entry(juice_agent_t *agent) {
4645
juice_concurrency_mode_t mode = agent->config.concurrency_mode;
47-
return conn_get_mode_entry(mode);
46+
return get_mode_entry(mode);
4847
}
4948

5049
static int acquire_registry(conn_mode_entry_t *entry, udp_socket_config_t *config, conn_registry_t **acquired) {
@@ -110,9 +109,9 @@ static void release_registry(conn_mode_entry_t *entry, conn_registry_t *registry
110109
return;
111110

112111
// registry must be locked
113-
bool canRelease = entry->can_release_registry_func ? entry->can_release_registry_func(registry) : true;
112+
bool can_release = entry->can_release_registry_func ? entry->can_release_registry_func(registry) : true;
114113

115-
if (registry->agents_count == 0 && canRelease) {
114+
if (registry->agents_count == 0 && can_release) {
116115
JLOG_DEBUG("No connection left, destroying connections registry");
117116
mutex_unlock(&registry->mutex);
118117

src/conn_thread.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "socket.h"
1313
#include "thread.h"
1414
#include "udp.h"
15-
#include "conn.h"
1615

1716
#include <assert.h>
1817
#include <string.h>

0 commit comments

Comments
 (0)