Re: [OpenSIPS-Devel] [opensips] Feature sipmsgvalidate for tofrom (#294)

2014-08-22 Thread Liviu Chircu
Merged #294.

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/294#event-156081596___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


[OpenSIPS-Devel] [opensips] Feature sipmsgvalidate for tofrom (#294)

2014-08-11 Thread Mihai Tiganus

You can merge this Pull Request by running:

  git pull https://github.com/tallicamike/opensips 
feature-sipmsgvalidate-for-tofrom

Or you can view, comment on it, or merge it online at:

  https://github.com/OpenSIPS/opensips/pull/294

-- Commit Summary --

  * check validity for to/from in sipmsg_validate
  * sanity check for contact header(s)

-- File Changes --

M modules/sipmsgops/README (10)
M modules/sipmsgops/doc/sipmsgops_admin.xml (18)
M modules/sipmsgops/sipmsgops.c (451)

-- Patch Links --

https://github.com/OpenSIPS/opensips/pull/294.patch
https://github.com/OpenSIPS/opensips/pull/294.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/294
___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] [opensips] Feature sipmsgvalidate for tofrom (#294)

2014-08-11 Thread Walter Doekes
  
 - return 1;
 +return 1;

You're reindenting huge bits of file here.

Looks like your replacing tabs with four spaces. That doesn't help the review, 
nor the code base. Please use tabs for every 4 spaces and force-push over this.

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/294/files#r16042488___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] [opensips] Feature sipmsgvalidate for tofrom (#294)

2014-08-11 Thread Walter Doekes
 +if ((hdrs_len+2=msg-len)  
 (strncmp(CRLF,msg-unparsed,CRLF_LEN)==0) )
 +body.s = msg-unparsed + CRLF_LEN;
 +else if ( (hdrs_len+1=msg-len) 
 +(*(msg-unparsed)=='\n' || *(msg-unparsed)=='\r' ) )
 +body.s = msg-unparsed + 1;
 +else {
 +/* no body */
 +body.s = NULL;
 +body.len = 0;
 +}
 +
 +/* determine the length of the body */
 +body.len = msg-buf + msg-len - body.s;
 +
 +if (get_content_length(msg) != body.len) {
 +snprintf(reason, MAX_REASON-1, invalid body - content length 
 %ld different then 

different *than

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/294/files#r16042525___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


Re: [OpenSIPS-Devel] [opensips] Feature sipmsgvalidate for tofrom (#294)

2014-08-11 Thread Walter Doekes
 - goto failed;
 - }
 -
 - if (body.len  body.s) {
 - /* if it really has body, check for content type */
 - ret = SV_NO_CONTENT_TYPE;
 - CHECK_HEADER(, content_type);
 - }
 - }
 +if(flags  SIP_PARSE_CONTACT) {
 +/* iterate through Contact headers */
 +for(ptr = msg-contact; ptr; ptr = ptr-sibling) {
 +/* parse Contact header */
 +if(!ptr-parsed  (parse_contact(ptr)  0 
 +|| !ptr-parsed)) {
 +strcpy(reason, failed to parse \'Contact\' 
 header);

No need to escape single quotes within double quoted strings.

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/294/files#r16042545___
Devel mailing list
Devel@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel