|
@@ -36,11 +36,6 @@
|
|
#include "../../udp_server.h"
|
|
#include "../../udp_server.h"
|
|
#include "../../pt.h"
|
|
#include "../../pt.h"
|
|
|
|
|
|
-#define CONTACT_PREFIX "Contact: <"
|
|
|
|
-#define CONTACT_SUFFIX ">;msilo=yes"CRLF
|
|
|
|
-#define CONTACT_PREFIX_LEN (sizeof(CONTACT_PREFIX)-1)
|
|
|
|
-#define CONTACT_SUFFIX_LEN (sizeof(CONTACT_SUFFIX)-1)
|
|
|
|
-
|
|
|
|
extern int ms_add_date;
|
|
extern int ms_add_date;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -186,21 +181,21 @@ error:
|
|
|
|
|
|
/** build MESSAGE headers
|
|
/** build MESSAGE headers
|
|
*
|
|
*
|
|
- * Add Content-Type, Contact, Date, and extra headers if they exist
|
|
|
|
|
|
+ * Add Content-Type, Date, and extra headers if they exist
|
|
* expects - max buf len of the resulted body in body->len
|
|
* expects - max buf len of the resulted body in body->len
|
|
* - body->s MUST be allocated
|
|
* - body->s MUST be allocated
|
|
* return: 0 OK ; -1 error
|
|
* return: 0 OK ; -1 error
|
|
* */
|
|
* */
|
|
-int m_build_headers(str *buf, str ctype, str contact, time_t date, str extra)
|
|
|
|
|
|
+int m_build_headers(str *buf, str ctype, time_t date, str extra)
|
|
{
|
|
{
|
|
char *p;
|
|
char *p;
|
|
char strDate[48];
|
|
char strDate[48];
|
|
int lenDate = 0;
|
|
int lenDate = 0;
|
|
|
|
|
|
- if(!buf || !buf->s || buf->len <= 0 || ctype.len < 0 || contact.len < 0
|
|
|
|
- || buf->len <= ctype.len+contact.len+extra.len+14
|
|
|
|
|
|
+ if(!buf || !buf->s || buf->len <= 0 || ctype.len < 0
|
|
|
|
+ || buf->len <= ctype.len+extra.len+14
|
|
/*Content-Type: */
|
|
/*Content-Type: */
|
|
- +CRLF_LEN+CONTACT_PREFIX_LEN+CONTACT_SUFFIX_LEN)
|
|
|
|
|
|
+ +CRLF_LEN)
|
|
goto error;
|
|
goto error;
|
|
|
|
|
|
p = buf->s;
|
|
p = buf->s;
|
|
@@ -220,15 +215,6 @@ int m_build_headers(str *buf, str ctype, str contact, time_t date, str extra)
|
|
p += CRLF_LEN;
|
|
p += CRLF_LEN;
|
|
|
|
|
|
}
|
|
}
|
|
- if(contact.len > 0)
|
|
|
|
- {
|
|
|
|
- strncpy(p, CONTACT_PREFIX, CONTACT_PREFIX_LEN);
|
|
|
|
- p += CONTACT_PREFIX_LEN;
|
|
|
|
- strncpy(p, contact.s, contact.len);
|
|
|
|
- p += contact.len;
|
|
|
|
- strncpy(p, CONTACT_SUFFIX, CONTACT_SUFFIX_LEN);
|
|
|
|
- p += CONTACT_SUFFIX_LEN;
|
|
|
|
- }
|
|
|
|
if (extra.len > 0) {
|
|
if (extra.len > 0) {
|
|
strncpy(p, extra.s, extra.len);
|
|
strncpy(p, extra.s, extra.len);
|
|
p += extra.len;
|
|
p += extra.len;
|