X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=submit%2Fsubmitd.h;h=13524229603b5c5fcb902c78ac79dc6b9277f6be;hb=3043ffa0cb666e509d5b07e479ead4792fbf722d;hp=7e0d4345378b656efc1cdbccb5f7c5d167b67b52;hpb=0b68418072c29bd0d6e32c78f26c104117a5695a;p=eval.git diff --git a/submit/submitd.h b/submit/submitd.h index 7e0d434..1352422 100644 --- a/submit/submitd.h +++ b/submit/submitd.h @@ -26,11 +26,12 @@ struct conn { // Set up by the master process cnode n; u32 ip; + byte *ip_string; // (xmalloced) pid_t pid; uns id; struct access_rule *rule; // Rule matched by this connection int sk; // Client socket - byte *cert_name; // Client name from the certificate (NULL if no TLS) + byte *cert_name; // Client name from the certificate (NULL if no TLS) (xmalloced) // Used by the child process gnutls_session_t tls; // TLS session @@ -38,6 +39,8 @@ struct conn { struct mempool *pool; struct odes *request; struct odes *reply; + struct odes *task_status; + int task_lock_fd; byte *user; }; @@ -52,4 +55,32 @@ void NONRET client_error(char *msg, ...); int process_init(struct conn *c); int process_command(struct conn *c); +/* tasks.c */ + +struct task { + cnode n; + byte *name; + uns open_data; // Number of parts for open-data tasks + clist parts; // List of parts of this task (simp_nodes) + clist *extensions; // List of allowed extensions for this task (simp_nodes) +}; + +extern clist task_list; +extern struct cf_section tasks_conf; + +struct task *task_find(byte *name); +int part_exists_p(struct task *t, byte *name); +int user_exists_p(byte *user); +int ext_exists_p(struct task *t, byte *ext); + +void task_lock_status(struct conn *c); +void task_unlock_status(struct conn *c, uns write_back); +void task_load_status(struct conn *c); + +struct odes *task_status_find_task(struct conn *c, struct task *t, uns create); +struct odes *task_status_find_part(struct odes *t, byte *part, uns create); + +void task_submit_part(byte *user, byte *task, byte *part, byte *ext, uns version, struct fastbuf *fb); +void task_delete_part(byte *user, byte *task, byte *part, byte *ext, uns version); + #endif