X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=submit%2Fsubmitd.h;h=db7a62eccf92e01a27aa5df3cea848014e2b38f0;hb=50cc126ebe949259a54f153a123848d771601b77;hp=9f73326730460e904645c65ef7ea10c3310a39b9;hpb=b451c5db7c24116c306eb1ce207641350ef98d8f;p=eval.git diff --git a/submit/submitd.h b/submit/submitd.h index 9f73326..db7a62e 100644 --- a/submit/submitd.h +++ b/submit/submitd.h @@ -14,9 +14,14 @@ #include #include -struct access_rule { +struct ip_node { cnode n; struct ip_addrmask addrmask; +}; + +struct access_rule { + cnode n; + clist ip_list; uns allow_admin; uns plain_text; uns max_conn; @@ -26,12 +31,12 @@ struct conn { // Set up by the master process cnode n; u32 ip; - byte *ip_string; // (xmalloced) + char *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) (xmalloced) + char *cert_name; // Client name from the certificate (NULL if no TLS) (xmalloced) // Used by the child process gnutls_session_t tls; // TLS session @@ -39,10 +44,14 @@ struct conn { struct mempool *pool; struct odes *request; struct odes *reply; - byte *user; + struct odes *task_status; + int task_lock_fd; + char *user; }; extern uns max_request_size, max_attachment_size, trace_commands; +extern uns max_versions; +extern char *history_format; /* submitd.c */ @@ -57,13 +66,29 @@ int process_command(struct conn *c); struct task { cnode n; - byte *name; + char *name; + uns open_data; // Number of parts for open-data tasks + uns max_size; // Maximum size (0=use global default) + 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 user_exists_p(byte *user); +struct task *task_find(char *name); +int part_exists_p(struct task *t, char *name); +int user_exists_p(char *user); +int ext_exists_p(struct task *t, char *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, char *part, uns create); + +void task_submit_part(char *user, char *task, char *part, char *ext, uns version, struct fastbuf *fb); +void task_delete_part(char *user, char *task, char *part, char *ext, uns version); #endif