projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5fca595
)
Fix compression when using the SPTPS protocol.
author
Guus Sliepen
<guus@tinc-vpn.org>
Wed, 24 Jul 2013 18:48:31 +0000
(20:48 +0200)
committer
Guus Sliepen
<guus@tinc-vpn.org>
Wed, 24 Jul 2013 18:48:31 +0000
(20:48 +0200)
src/net_packet.c
patch
|
blob
|
history
diff --git
a/src/net_packet.c
b/src/net_packet.c
index
1254e48
..
6f7a3a1
100644
(file)
--- a/
src/net_packet.c
+++ b/
src/net_packet.c
@@
-776,10
+776,12
@@
bool send_sptps_data(void *handle, uint8_t type, const char *data, size_t len) {
b64encode(data, buf, len);
/* If no valid key is known yet, send the packets using ANS_KEY requests,
to ensure we get to learn the reflexive UDP address. */
b64encode(data, buf, len);
/* If no valid key is known yet, send the packets using ANS_KEY requests,
to ensure we get to learn the reflexive UDP address. */
- if(!to->status.validkey)
- return send_request(to->nexthop->connection, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, myself->name, to->name, buf, myself->incompression);
- else
+ if(!to->status.validkey) {
+ to->incompression = myself->incompression;
+ return send_request(to->nexthop->connection, "%d %s %s %s -1 -1 -1 %d", ANS_KEY, myself->name, to->name, buf, to->incompression);
+ } else {
return send_request(to->nexthop->connection, "%d %s %s %d %s", REQ_KEY, myself->name, to->name, REQ_SPTPS, buf);
return send_request(to->nexthop->connection, "%d %s %s %d %s", REQ_KEY, myself->name, to->name, REQ_SPTPS, buf);
+ }
}
/* Otherwise, send the packet via UDP */
}
/* Otherwise, send the packet via UDP */