X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=inline;f=submit%2Fcommands.c;h=93d9ae9e52c836ca49d2e7a5d7479427c3fe28dd;hb=9306a593e097b30b55196f0fb7dd7c189389a0d3;hp=93f5b83509f6edf08c86046612afd1d8c4e61ed4;hpb=2c3e101dcd66d9237c09653395350bafe5884b86;p=eval.git diff --git a/submit/commands.c b/submit/commands.c index 93f5b83..93d9ae9 100644 --- a/submit/commands.c +++ b/submit/commands.c @@ -93,8 +93,9 @@ static void copy_attrs(struct odes *dest, struct odes *src) { for (struct oattr *a = src->attrs ; a; a=a->next) - for (struct oattr *aa = a; aa; aa=aa->same) - obj_add_attr(dest, aa->attr, aa->val); + if (a->attr < OBJ_ATTR_SON) + for (struct oattr *aa = a; aa; aa=aa->same) + obj_add_attr(dest, aa->attr, aa->val); } static void @@ -108,6 +109,8 @@ cmd_status(struct conn *c) struct odes *to = task_status_find_task(c, t, 1); struct odes *tr = obj_add_son(c->reply, 'T' + OBJ_ATTR_SON); copy_attrs(tr, to); + CLIST_FOR_EACH(simp_node *, x, *t->extensions) + obj_add_attr(tr, 'A', x->s); CLIST_FOR_EACH(simp_node *, p, t->parts) { struct odes *po = task_status_find_part(to, p->s, 1); @@ -199,9 +202,6 @@ cmd_submit(struct conn *c) if (!fb) return; - // FIXME: Check contest time - // FIXME: Keep history of submitted tasks - task_lock_status(c); struct odes *tasko = task_status_find_task(c, task, 1); struct odes *parto = task_status_find_part(tasko, pname, 1); @@ -224,10 +224,9 @@ cmd_submit(struct conn *c) struct odes *vero = obj_add_son(parto, 'V' + OBJ_ATTR_SON); obj_set_attr_num(vero, 'V', ++last_ver); obj_set_attr_num(vero, 'T', time(NULL)); + obj_set_attr_num(vero, 'L', obj_find_anum(c->request, 'S', 0)); obj_set_attr(vero, 'S', "submitted"); obj_set_attr(vero, 'X', ext); - // FIXME: hash - // FIXME: remove old versions from the status file? task_submit_part(c->user, tname, pname, ext, last_ver, fb); obj_set_attr_num(parto, 'V', last_ver); task_unlock_status(c, 1);