Esempio n. 1
0
static NEOERR* aux_cmd_emailadd(struct aux_entry *e, QueueEntry *q)
{
    STRING str; string_init(&str);
    char sum[LEN_MD5], *content;
    NEOERR *err;
    mdb_conn *db = e->db;

    REQ_GET_PARAM_STR(q->hdfrcv, "content", content);
    
    mstr_md5_str(content, sum);
    hdf_set_value(q->hdfrcv, "checksum", sum);

    HDF *node = hdf_get_child(q->hdfrcv, "mto");

insert:
    if (node) hdf_set_value(q->hdfrcv, "to", hdf_obj_value(node));
    
    err = mdb_build_incol(q->hdfrcv,
                          hdf_get_obj(g_cfg, CONFIG_PATH".InsertCol.email"),
                          &str);
    if (err != STATUS_OK) return nerr_pass(err);
    
    MDB_EXEC(db, NULL, "INSERT INTO email %s", NULL, str.buf);
    string_clear(&str);

    if (node) {
        node = hdf_obj_next(node);
        if (node) goto insert;
    }

    return STATUS_OK;
}
Esempio n. 2
0
File: md.c Progetto: adderly/cmoon
int main(int argc, char **argv)
{
    char *buf = "1861017895712012/12/13 0:00:0011234n-2Sv$#xv%Mvz@";
    int iarr[6];

    for (int x = 0; x < 6; x++) {
        printf("%d\t", iarr[x]);
    }

    mutil_rand_numbers(6, iarr, 6);

    printf("\n\n\n");

    for (int x = 0; x < 6; x++) {
        printf("%d\t", iarr[x]);
    }


    char out[LEN_MD5] = {0};

    mstr_md5_str(buf, out);

    //printf("%s %d\n", out, 22 % atoi(argv[1]));
    
    return 0;
}