]> mj.ucw.cz Git - subauth.git/blobdiff - server/subauthd.h
Server: Maximum comment size is limited (configurable)
[subauth.git] / server / subauthd.h
index f676b5edcc8ec400bd54de21fbd3700479867c7b..1e867541ef2991231f41f3434d186bfd2ce30097 100644 (file)
 
 #include <ucw/clists.h>
 #include <ucw/mainloop.h>
+#include <ucw/mempool.h>
 #include <ucw-json/json.h>
 
 #define SOCKET_TIMEOUT 60000           // in ms
-#define MAX_PACKET_SIZE 16384
 #define MAX_OOB_DATA_SIZE 4096
 
 struct client {
   struct main_file socket;
   struct main_timer timer;
   int uid;
+  struct mempool *pool;
   struct json_context *json;
   struct json_node *request;
   struct json_node *reply;
@@ -28,6 +29,7 @@ struct client {
 extern clist zone_list;                        // of struct auth_zone
 extern char *database_name;
 extern char *temp_key_file;
+extern uint max_comment_size;
 
 /* cmd.c */
 
@@ -100,7 +102,7 @@ void auth_delete_acct(struct auth_acct *aa);
 void auth_delete_token(struct auth_token *at);
 struct auth_token *auth_create_token(struct auth_acct *aa);
 void auth_set_token_passwd(struct auth_token *at, const char *passwd);
-char *auth_set_token_generated(struct auth_token *at, const char *comment);
+char *auth_set_token_generated(struct auth_token *at, const char *comment, struct mempool *pool);
 bool auth_check_token(struct auth_token *at, const char *passwd);
 
 extern struct auth_token *auth_fake_token;
@@ -108,5 +110,6 @@ extern struct auth_token *auth_fake_token;
 /* temp.c */
 
 void temp_init(void);
-char *temp_generate(const char *zone, const char *login, uint validity);
-const char *temp_check(const char *zone, const char *login, const char *token);
+char *temp_generate(const char *zone, const char *login, uint validity, struct mempool *pool);
+const char *temp_check(const char *zone, const char *login, const char *token, struct mempool *pool);
+const char *temp_shorten(const char *token, struct mempool *pool);