4 * (c) 2007 Martin Mares <mj@ucw.cz>
10 #include "lib/clists.h"
11 #include "lib/ipaccess.h"
12 #include "lib/fastbuf.h"
14 #include <gnutls/gnutls.h>
15 #include <gnutls/x509.h>
19 struct ip_addrmask addrmask;
31 // Set up by the master process
34 char *ip_string; // (xmalloced)
37 struct access_rule *rule; // Rule matched by this connection
38 int sk; // Client socket
39 char *cert_name; // Client name from the certificate (NULL if no TLS) (xmalloced)
41 // Used by the child process
42 gnutls_session_t tls; // TLS session
43 struct fastbuf rx_fb, tx_fb; // Fastbufs for communication with the client (either plain-text or TLS)
47 struct odes *task_status;
52 extern uns max_request_size, max_attachment_size, trace_commands;
53 extern uns max_versions;
54 extern char *history_format;
58 void NONRET client_error(char *msg, ...);
62 int process_init(struct conn *c);
63 int process_command(struct conn *c);
70 uns open_data; // Number of parts for open-data tasks
71 uns max_size; // Maximum size (0=use global default)
72 clist parts; // List of parts of this task (simp_nodes)
73 clist *extensions; // List of allowed extensions for this task (simp_nodes)
76 extern clist task_list;
77 extern struct cf_section tasks_conf;
79 struct task *task_find(char *name);
80 int part_exists_p(struct task *t, char *name);
81 int user_exists_p(char *user);
82 int ext_exists_p(struct task *t, char *ext);
84 void task_lock_status(struct conn *c);
85 void task_unlock_status(struct conn *c, uns write_back);
86 void task_load_status(struct conn *c);
88 struct odes *task_status_find_task(struct conn *c, struct task *t, uns create);
89 struct odes *task_status_find_part(struct odes *t, char *part, uns create);
91 void task_submit_part(char *user, char *task, char *part, char *ext, uns version, struct fastbuf *fb);
92 void task_delete_part(char *user, char *task, char *part, char *ext, uns version);