summaryrefslogtreecommitdiffstats
path: root/PICA_node.h
diff options
context:
space:
mode:
authorAnton <anton@picapica.im>2026-08-12 22:50:58 +0400
committerAnton <anton@picapica.im>2026-08-12 22:50:58 +0400
commit386f189f03fc199285716d78a059b790bd1b9a6b (patch)
tree901db0914575e84e25e56bea14d2b709b982507e /PICA_node.h
parent3c1dd02283dc732038bd730a677fed519305e01b (diff)
downloadpica-pica-386f189f03fc199285716d78a059b790bd1b9a6b.tar.gz
pica-pica-386f189f03fc199285716d78a059b790bd1b9a6b.zip
pica-node: fix c2c packet processing issues
Diffstat (limited to 'PICA_node.h')
-rw-r--r--PICA_node.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/PICA_node.h b/PICA_node.h
index 78cb997..51fc51c 100644
--- a/PICA_node.h
+++ b/PICA_node.h
@@ -102,6 +102,15 @@
#define DEFAULT_BUF_SIZE 4096
+//Relay buffers of a c2c link. procmsg_N2NMSG() drops the whole link when an
+//incoming N2NMSG does not fit into the free space left in these, and the
+//announced payload length of an N2NMSG is a 16 bit field less the two peer ids
+//(65535 - 2 * PICA_ID_SIZE), so anything below 64K makes that a routine event
+//instead of an exceptional one - a link carrying a call has a backlog in both
+//directions most of the time. Deliberately not DEFAULT_BUF_SIZE: that one is
+//also the r_buf/w_buf granularity paid for by every connected client.
+#define C2C_BUF_SIZE 65536
+
struct nodelink;
struct client