Skip to content

Commit ad13e30

Browse files
committed
tweak pending tracking
1 parent b6f897c commit ad13e30

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib/io/master.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ static int pending_free(fr_io_pending_packet_t *pending)
12131213
return 0;
12141214
}
12151215

1216-
static fr_io_pending_packet_t *fr_io_pending_alloc(fr_io_client_t *client,
1216+
static fr_io_pending_packet_t *fr_io_pending_alloc(fr_io_connection_t *connection, fr_io_client_t *client,
12171217
uint8_t const *buffer, size_t packet_len,
12181218
fr_io_track_t *track,
12191219
int priority)
@@ -1245,7 +1245,7 @@ static fr_io_pending_packet_t *fr_io_pending_alloc(fr_io_client_t *client,
12451245
* we pause the FD, so the number of
12461246
* pending packets will always be small.
12471247
*/
1248-
if (!client->connection) client->thread->num_pending_packets++;
1248+
if (!connection) client->thread->num_pending_packets++;
12491249

12501250
return pending;
12511251
}
@@ -1717,7 +1717,7 @@ static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time
17171717
* to track pending packets.
17181718
*/
17191719
if (!connection && inst->max_pending_packets && (thread->num_pending_packets >= inst->max_pending_packets)) {
1720-
DEBUG("Too many pending packets for dynamic client %pV - discarding packet",
1720+
DEBUG("Too many pending packets from dynamic client %pV - discarding packet",
17211721
fr_box_ipaddr(client->src_ipaddr));
17221722

17231723
discard:
@@ -1728,7 +1728,7 @@ static ssize_t mod_read(fr_listen_t *li, void **packet_ctx, fr_time_t *recv_time
17281728
/*
17291729
* Allocate the pending packet structure.
17301730
*/
1731-
pending = fr_io_pending_alloc(client, buffer, packet_len,
1731+
pending = fr_io_pending_alloc(connection, client, buffer, packet_len,
17321732
track, priority);
17331733
if (!pending) {
17341734
INFO("proto_%s - Failed allocating space for dynamic client %pV - discarding packet",
@@ -1897,7 +1897,7 @@ static int mod_inject(fr_listen_t *li, uint8_t const *buffer, size_t buffer_len,
18971897
/*
18981898
* Remember to restore this packet later.
18991899
*/
1900-
pending = fr_io_pending_alloc(connection->client, buffer, buffer_len,
1900+
pending = fr_io_pending_alloc(connection, connection->client, buffer, buffer_len,
19011901
track, priority);
19021902
if (!pending) {
19031903
DEBUG2("Failed injecting packet due to allocation error");

0 commit comments

Comments
 (0)