Skip to content

Commit

Permalink
compression: re-compute the uri after rebuilding the buffer
Browse files Browse the repository at this point in the history
When freeing the buffer in be3b603, the URI in transaction remained
pointing to the old buffer. Therefore when building local ACK or CANCEL,
URI was having garbage.

Fixes #1575

Many thanks to Jock McKechnie for reporing it and offering testing support
  • Loading branch information
razvancrainea committed Dec 21, 2018
1 parent a188dac commit d877663
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/compression/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ void wrap_tm_func(struct cell* t, int type, struct tmcb_params* p)

t->uac[p->code].request.buffer.s = buf;
t->uac[p->code].request.buffer.len = olen;
/* we also need to compute the uri so that it points within the new buffer */
t->uac[p->code].uri.s = buf + t->method.len + 1;
/* uri.len should be the same, since it is not changed by compression */
}

int wrap_msg_compress(str* buf, struct sip_msg* p_msg) {
Expand Down

0 comments on commit d877663

Please sign in to comment.