"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/osipparser2/osip_via.c" between
libosip2-5.0.0.tar.gz and libosip2-5.1.0.tar.gz

About: The GNU oSIP library is an implementation of SIP (RFC3261).

osip_via.c  (libosip2-5.0.0):osip_via.c  (libosip2-5.1.0)
skipping to change at line 254 skipping to change at line 254
ipv6host = NULL; ipv6host = NULL;
} }
if ((port != NULL) && (port < via_params)) { if ((port != NULL) && (port < via_params)) {
if (via_params - port < 2) if (via_params - port < 2)
return OSIP_SYNTAXERROR; return OSIP_SYNTAXERROR;
via->port = (char *) osip_malloc (via_params - port); via->port = (char *) osip_malloc (via_params - port);
if (via->port == NULL) if (via->port == NULL)
return OSIP_NOMEM; return OSIP_NOMEM;
osip_clrncpy (via->port, port + 1, via_params - port - 1); osip_clrncpy (via->port, port + 1, via_params - port - 1);
if(osip_atoi(via->port) < 0) if (osip_atoi (via->port) < 0)
return OSIP_SYNTAXERROR; return OSIP_SYNTAXERROR;
} }
else else
port = via_params; port = via_params;
/* host is already set in the case of ipv6 */ /* host is already set in the case of ipv6 */
if (ipv6host != NULL) if (ipv6host != NULL)
return OSIP_SUCCESS; return OSIP_SUCCESS;
if (port - host < 2) if (port - host < 2)
skipping to change at line 314 skipping to change at line 314
} }
else { else {
if (via->port == NULL) if (via->port == NULL)
sprintf (buf, "SIP/%s/%s %s", via->version, via->protocol, via->host); sprintf (buf, "SIP/%s/%s %s", via->version, via->protocol, via->host);
else else
sprintf (buf, "SIP/%s/%s %s:%s", via->version, via->protocol, via->host, v ia->port); sprintf (buf, "SIP/%s/%s %s:%s", via->version, via->protocol, via->host, v ia->port);
} }
{ {
osip_list_iterator_t it; osip_list_iterator_t it;
osip_generic_param_t *u_param = (osip_generic_param_t*) osip_list_get_first( osip_generic_param_t *u_param = (osip_generic_param_t *) osip_list_get_first
&via->via_params, &it); (&via->via_params, &it);
while (u_param != OSIP_SUCCESS) { while (u_param != OSIP_SUCCESS) {
if (u_param->gvalue == NULL) if (u_param->gvalue == NULL)
plen = strlen (u_param->gname) + 2; plen = strlen (u_param->gname) + 2;
else else
plen = strlen (u_param->gname) + strlen (u_param->gvalue) + 3; plen = strlen (u_param->gname) + strlen (u_param->gvalue) + 3;
len = len + plen; len = len + plen;
buf = (char *) osip_realloc (buf, len); buf = (char *) osip_realloc (buf, len);
tmp = buf; tmp = buf;
tmp = tmp + strlen (tmp); tmp = tmp + strlen (tmp);
if (u_param->gvalue == NULL) if (u_param->gvalue == NULL)
sprintf (tmp, ";%s", u_param->gname); sprintf (tmp, ";%s", u_param->gname);
else else
sprintf (tmp, ";%s=%s", u_param->gname, u_param->gvalue); sprintf (tmp, ";%s=%s", u_param->gname, u_param->gvalue);
u_param = (osip_generic_param_t *) osip_list_get_next(&it); u_param = (osip_generic_param_t *) osip_list_get_next (&it);
} }
} }
if (via->comment != NULL) { if (via->comment != NULL) {
len = len + strlen (via->comment) + 4; len = len + strlen (via->comment) + 4;
buf = (char *) osip_realloc (buf, len); buf = (char *) osip_realloc (buf, len);
tmp = buf; tmp = buf;
tmp = tmp + strlen (tmp); tmp = tmp + strlen (tmp);
snprintf (tmp, len - (tmp - buf), " (%s)", via->comment); snprintf (tmp, len - (tmp - buf), " (%s)", via->comment);
} }
 End of changes. 3 change blocks. 
4 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)