Module: sip-router
Branch: master
Commit: 3b557293a33f6f3003fdd62a45e02cf8736b534e
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3b55729…
Author: Andrew Mortensen <admorten(a)isc.upenn.edu>
Committer: Andrew Mortensen <admorten(a)isc.upenn.edu>
Date: Mon Mar 4 23:13:53 2013 -0500
sca: fix regression dropping Expires header from SUBSCRIBE replies.
- extra_headers.len lacked Expires header length after snprintf.
---
modules/sca/sca_subscribe.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules/sca/sca_subscribe.c b/modules/sca/sca_subscribe.c
index 904a3c5..66e63c8 100644
--- a/modules/sca/sca_subscribe.c
+++ b/modules/sca/sca_subscribe.c
@@ -1334,10 +1334,11 @@ sca_subscription_reply( sca_mod *scam, int status_code, char
*status_msg,
len = snprintf( extra_headers.s + extra_headers.len,
sizeof( hdr_buf ) - extra_headers.len,
"Expires: %d%s", expires, CRLF );
- if ( len >= sizeof( hdr_buf ) || len < 0 ) {
+ if ( len >= (sizeof( hdr_buf ) - extra_headers.len) || len < 0 ) {
LM_ERR( "sca_subscription_reply: extra headers too long" );
return( -1 );
}
+ extra_headers.len += len;
} else if ( status_code == 480 ) {
/* tell loser of line-seize SUBSCRIBE race to try again shortly */
extra_headers.s = hdr_buf;