src/siri/admin/client.c
/*
 * Called when an error message is received.
 */
Called when an error message is received.
Called when an error message is received .
static void CLIENT_on_error_msg(
        siri_admin_client_t * adm_client,
        sirinet_pkg_t * pkg)
{
    qp_unpacker_t unpacker;
    qp_unpacker_init(&unpacker, pkg->data, pkg->len);
    qp_obj_t qp_err;
    if (qp_is_map(qp_next(&unpacker, NULL)) &&
        qp_next(&unpacker, NULL) == QP_RAW &&
        qp_next(&unpacker, &qp_err) == QP_RAW)
    {
        CLIENT_err(
                adm_client,
                "error on server '%s:%u': %.*s",
                adm_client->host,
                adm_client->port,
                (int) qp_err.len,
                qp_err.via.raw);
    }
    else
    {
        CLIENT_err(
                adm_client,
                "unexpected error on server '%s:%u'",
                adm_client->host,
                adm_client->port);
    }
}
static void CLIENT_on_error_msg ( siri_admin_client_t * adm_client , sirinet_pkg_t * pkg ) { qp_unpacker_t unpacker ; qp_unpacker_init ( & unpacker , pkg -> data , pkg -> len ) ; qp_obj_t qp_err ; if ( qp_is_map ( qp_next ( & unpacker , NULL ) ) && qp_next ( & unpacker , NULL ) == QP_RAW && qp_next ( & unpacker , & qp_err ) == QP_RAW ) { CLIENT_err ( adm_client , " " , adm_client -> host , adm_client -> port , ( int ) qp_err . len , qp_err . via . raw ) ; } else { CLIENT_err ( adm_client , " " , adm_client -> host , adm_client -> port ) ; } }
Called when an error message is received.
Called when an error message is received .