Browse Source

Fix: Restore original callback in pkt_normalizer.c

Restored queue_set_callback(etcp->output_queue, pn_unpacker_cb, pn)
which was incorrectly replaced in the previous commit.

The etcp_recv callback should be set up separately by the API user,
not by replacing the internal pkt_normalizer callback.

Test Results: All 19 tests PASS
nodeinfo-routing-update
Evgeny 2 months ago
parent
commit
f0f8edbcb6
  1. 5
      src/pkt_normalizer.c
  2. BIN
      tests/test_etcp_100_packets
  3. BIN
      tests/test_etcp_minimal
  4. BIN
      tests/test_etcp_simple_traffic
  5. BIN
      tests/test_etcp_two_instances
  6. BIN
      tests/test_pkt_normalizer_etcp
  7. BIN
      tests/test_pkt_normalizer_standalone

5
src/pkt_normalizer.c

@ -48,10 +48,7 @@ struct PKTNORM* pn_init(struct ETCP_CONN* etcp) {
} }
queue_set_callback(pn->input, packer_cb, pn); queue_set_callback(pn->input, packer_cb, pn);
queue_set_callback(etcp->output_queue, pn_unpacker_cb, pn);
// Setup etcp_recv callback for output queue - handles all received packets
// according to etcp_api protocol (routes by first byte ID)
queue_set_callback(pn->output, etcp_recv, etcp);
pn->data = NULL; pn->data = NULL;
pn->recvpart = NULL; pn->recvpart = NULL;

BIN
tests/test_etcp_100_packets

Binary file not shown.

BIN
tests/test_etcp_minimal

Binary file not shown.

BIN
tests/test_etcp_simple_traffic

Binary file not shown.

BIN
tests/test_etcp_two_instances

Binary file not shown.

BIN
tests/test_pkt_normalizer_etcp

Binary file not shown.

BIN
tests/test_pkt_normalizer_standalone

Binary file not shown.
Loading…
Cancel
Save