Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 5a24c34f rédigé par Kubat's avatar Kubat
Parcourir les fichiers

DB: Add a macro to define the default 'iteration count' when no srv is...

DB: Add a macro to define the default 'iteration count' when no srv is available in the find commands
parent 7b02ac05
Branches
Étiquettes
1 requête de fusion!157Caching for karas & refactor & others
......@@ -126,6 +126,9 @@ void ___lkt_print(const char *section, const char *format, ...);
#define LKT_DB_LANG "language"
#define LKT_DB_ALL "string"
/* Default iteration count in search_iter */
#define LKT_DB_DEFAULT_ITERATION_MAX 100
#define LEKTOR_TAG_MAX 256
#define LKT_MESSAGE_ARGS_MAX 32
#define LKT_MESSAGE_MAX 2048
......
......@@ -75,9 +75,8 @@ database_search_free(struct lkt_search *search)
struct lkt_search *
database_search_new(struct lkt_state *srv, size_t c, int cont, function_ptr call)
{
#pragma message(TODO "Use a macro to set the default line count per search")
/* Minus 3 for control messages. If no server do it 100 by 100, use a macro for that... */
size_t msg_count = srv != NULL ? lkt_remaining_msg(srv, c) - 3 : 100;
/* Minus 3 for control messages. If no server do it `X` by `X`. */
size_t msg_count = srv != NULL ? lkt_remaining_msg(srv, c) - 3 : LKT_DB_DEFAULT_ITERATION_MAX;
struct lkt_search *ret_ptr = safe_malloc(sizeof(struct lkt_search));
struct lkt_search ret = {
.srv = srv,
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter