docs: late_resequenced counts held-then-delivered packets, not gaps avoided
Fix the false trailing clause in the udps_stats_t::late_resequenced comment, move udps_held_t from the tunable-limits section to internal-state next to udps_slot_t, and add braces to three braceless if bodies to match house style. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
6e79a67252
commit
45958a441a
2 files changed
+19
-14
No files matched your search
Vendored
+13
-12
@@ -38,15 +38,6 @@
|
||||
/** Total bytes the reorder ring may hold, so a fast stream cannot grow it without bound. */
|
||||
#define UDPS_REORDER_BYTES (4u * 1024u * 1024u)
|
||||
|
||||
typedef struct {
|
||||
uint8_t *buf; /**< owned; grown on demand to the payload's length */
|
||||
size_t cap;
|
||||
size_t len;
|
||||
uint32_t counter;
|
||||
double recv_time;
|
||||
int used;
|
||||
} udps_held_t;
|
||||
|
||||
/** Concurrent in-flight reassemblies. The server interleaves at most a couple. */
|
||||
#define UDPS_MAX_SLOTS 4
|
||||
|
||||
@@ -165,6 +156,16 @@ typedef struct {
|
||||
double first_seen;
|
||||
} udps_slot_t;
|
||||
|
||||
/** One slot in the reorder ring: a raw payload held until its counter is next. */
|
||||
typedef struct {
|
||||
uint8_t *buf; /**< owned; grown on demand to the payload's length */
|
||||
size_t cap;
|
||||
size_t len;
|
||||
uint32_t counter;
|
||||
double recv_time;
|
||||
int used;
|
||||
} udps_held_t;
|
||||
|
||||
struct udps_client {
|
||||
udps_client_config_t cfg;
|
||||
/* Owned copies: the caller's strings need not outlive the create call. */
|
||||
@@ -747,7 +748,7 @@ static int order_data(udps_client_t *c, const uint8_t *pl, size_t len,
|
||||
if (delta == 0) {
|
||||
int rc = deliver_data(c, pl, len, counter, recv_time, 0u, 0);
|
||||
c->next_counter = counter + 1u;
|
||||
if (rc == 0) rc = drain_held(c, 0u);
|
||||
if (rc == 0) { rc = drain_held(c, 0u); }
|
||||
return rc;
|
||||
}
|
||||
if (delta > 0) {
|
||||
@@ -1364,8 +1365,8 @@ int udps_client_poll(udps_client_t *c, int timeout_ms) {
|
||||
* the next arrival is 100 ms away, which is five times the whole budget. */
|
||||
if (c->gap_deadline > 0.0) {
|
||||
double left = c->gap_deadline - now_wall();
|
||||
if (left < 0.0) left = 0.0;
|
||||
if (left < budget) budget = left;
|
||||
if (left < 0.0) { left = 0.0; }
|
||||
if (left < budget) { budget = left; }
|
||||
}
|
||||
|
||||
FD_ZERO(&rset);
|
||||
|
||||
Reference in new issue
Block a user