Пример #1
0
/* returns -1 on error. */
int
osip_message_set_accept (osip_message_t * sip, const char *hvalue)
{
  osip_accept_t *accept;
  int i;

#if 0
  if (hvalue == NULL || hvalue[0] == '\0')
    return 0;
#endif

  i = accept_init (&accept);
  if (i != 0)
    return -1;
  i = osip_accept_parse (accept, hvalue);
  if (i != 0)
    {
      osip_accept_free (accept);
      return -1;
    }
  sip->message_property = 2;

  osip_list_add (sip->accepts, accept, -1);
  return 0;
}
Пример #2
0
/* returns -1 on error. */
int osip_message_set_accept(osip_message_t * sip, const char *hvalue)
{
	osip_accept_t *accept;
	int i;

	i = accept_init(&accept);
	if (i != 0)
		return i;
	i = osip_accept_parse(accept, hvalue);
	if (i != 0) {
		osip_accept_free(accept);
		return i;
	}
	sip->message_property = 2;

	osip_list_add(&sip->accepts, accept, -1);
	return OSIP_SUCCESS;
}