src/siri/net/promises.c
/*
 * This function will clean the promises type and list. The promises->cb
 * is responsible for calling 'sirinet_promise_decref' on each promise and
 * free promise->data.
 *
 * A promise reference count will be incremented by one.
 */
This function will clean the promises type and list. The promises->cb
is responsible for calling 'sirinet_promise_decref' on each promise and
free promise->data.

A promise reference count will be incremented by one.
This function will clean the promises type and list . The promises - > cb is responsible for calling ' sirinet_promise_decref ' on each promise and free promise - > data . A promise reference count will be incremented by one .
void sirinet_promises_on_response(
        sirinet_promise_t * promise,
        sirinet_pkg_t * pkg,
        int status)
{
    sirinet_promises_t * promises = (sirinet_promises_t *) promise->data;
    if (status)
    {
        log_debug(
                "Error occurred while sending package to '%s' (%s)",
                promise->server->name,
                sirinet_promise_strstatus((sirinet_promise_status_t) status));
        promise->data = NULL;
    }
    else
    {
        promise->data = (void *) sirinet_pkg_dup(pkg);
    }
    slist_append(promises->promises, (void *) promise);
    SIRINET_PROMISES_CHECK(promises)
}
void sirinet_promises_on_response ( sirinet_promise_t * promise , sirinet_pkg_t * pkg , int status ) { sirinet_promises_t * promises = ( sirinet_promises_t * ) promise -> data ; if ( status ) { log_debug ( " " , promise -> server -> name , sirinet_promise_strstatus ( ( sirinet_promise_status_t ) status ) ) ; promise -> data = NULL ; } else { promise -> data = ( void * ) sirinet_pkg_dup ( pkg ) ; } slist_append ( promises -> promises , ( void * ) promise ) ; SIRINET_PROMISES_CHECK ( promises ) }
This function will clean the promises type and list.
This function will clean the promises type and list .
/* we already have a log entry so this can be a debug log */ /* we can ignore errors from sirinet_pkg_dup() */