Ejemplo n.º 1
0
static void
publish_repo_update_event (CEvent *event, void *data)
{
    RepoUpdateEventData *rdata = event->data;

    char buf[128];
    snprintf (buf, sizeof(buf), "repo-update\t%s\t%s",
              rdata->repo_id, rdata->commit_id);

    seaf_mq_manager_publish_event (seaf->mq_mgr, buf);

    g_free (rdata->repo_id);
    g_free (rdata->commit_id);
    g_free (rdata);
}
Ejemplo n.º 2
0
static void
put_block_cb (CEvent *event, void *vprocessor)
{
    CcnetProcessor *processor = (CcnetProcessor *)vprocessor;
    USE_PRIV;
    BlockResponse *blk_rsp = event->data;

    char buf[256];
    snprintf (buf, sizeof(buf), "put-block\t%s\t%s\t%s\t%d",
              priv->repo_id, processor->peer_id, blk_rsp->block_id, blk_rsp->tx_bytes);

    seaf_mq_manager_publish_event (seaf->mq_mgr, buf);
    
    g_free (blk_rsp);
}
Ejemplo n.º 3
0
static void
publish_repo_event (CcnetProcessor *processor, const char *etype)
{
    USE_PRIV;
    GString *buf;

    if (!priv->user)
        return;

    buf = g_string_new (NULL);
    g_string_printf (buf, "%s\t%s\t%s\t%s\t%s\t%s",
                     etype, priv->user, priv->peer_addr,
                     priv->peer_name, priv->orig_repo_id,
                     priv->orig_path ? priv->orig_path : "/");

    seaf_mq_manager_publish_event (seaf->mq_mgr, buf->str);

    g_string_free (buf, TRUE);
}