curl_llist *
Curl_llist_alloc( curl_llist_dtor dtor ) {
	curl_llist *list;

	list = (curl_llist *)malloc( sizeof( curl_llist ) );
	if ( NULL == list ) {
		return NULL;
	}

	Curl_llist_init( list, dtor );

	return list;
}
Exemple #2
0
struct curl_llist *
Curl_llist_alloc(curl_llist_dtor dtor)
{
  struct curl_llist *list;

  list = (struct curl_llist *)malloc(sizeof(struct curl_llist));
  if(NULL == list)
    return NULL;

  Curl_llist_init(list, dtor);

  return list;
}
Exemple #3
0
static CURLcode bundle_create(struct Curl_easy *data,
                              struct connectbundle **cb_ptr)
{
  (void)data;
  DEBUGASSERT(*cb_ptr == NULL);
  *cb_ptr = malloc(sizeof(struct connectbundle));
  if(!*cb_ptr)
    return CURLE_OUT_OF_MEMORY;

  (*cb_ptr)->num_connections = 0;
  (*cb_ptr)->multiuse = BUNDLE_UNKNOWN;

  Curl_llist_init(&(*cb_ptr)->conn_list, (curl_llist_dtor) conn_llist_dtor);
  return CURLE_OK;
}
Exemple #4
0
/*
 * Curl_altsvc_init() creates a new altsvc cache.
 * It returns the new instance or NULL if something goes wrong.
 */
struct altsvcinfo *Curl_altsvc_init(void)
{
  struct altsvcinfo *asi = calloc(sizeof(struct altsvcinfo), 1);
  if(!asi)
    return NULL;
  Curl_llist_init(&asi->list, NULL);

  /* set default behavior */
  asi->flags = CURLALTSVC_H1
#ifdef USE_NGHTTP2
    | CURLALTSVC_H2
#endif
#ifdef USE_HTTP3
    /* TODO: adjust when known */
    | CURLALTSVC_H3
#endif
    ;
  return asi;
}