Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
a12dc31c
Vérifiée
Valider
a12dc31c
rédigé
Il y a 4 ans
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
MODULE: The parsing of the json is ok now, but filepath is incorrect
parent
2f68266f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion
!130
Resolve "Remove json-c"
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/base/json.c
+1
-1
1 ajout, 1 suppression
src/base/json.c
src/module/module_repo.c
+4
-3
4 ajouts, 3 suppressions
src/module/module_repo.c
avec
5 ajouts
et
4 suppressions
src/base/json.c
+
1
−
1
Voir le fichier @
a12dc31c
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
len = (end - str); \
len = (end - str); \
is_paren = 1; \
is_paren = 1; \
} else \
} else \
len = strcspn(str, __JSON_SPACE
);
\
len = strcspn(str, __JSON_SPACE
__JSON_END);
\
if (level == asked_level && len < LKT_LINE_MAX - 1) \
if (level == asked_level && len < LKT_LINE_MAX - 1) \
strncpy(dest, str, len); \
strncpy(dest, str, len); \
str += len; \
str += len; \
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/module/module_repo.c
+
4
−
3
Voir le fichier @
a12dc31c
...
@@ -311,6 +311,7 @@ __handle_got_json_dl(struct kara *kara, int current_id)
...
@@ -311,6 +311,7 @@ __handle_got_json_dl(struct kara *kara, int current_id)
safe_snprintf
(
kara
->
url
,
LKT_LINE_MAX
,
kara
->
repo
->
get_id_file
,
kara
->
id
);
safe_snprintf
(
kara
->
url
,
LKT_LINE_MAX
,
kara
->
repo
->
get_id_file
,
kara
->
id
);
LOG_INFO
(
"REPO"
,
"Start downloading kara %ld to %s"
,
kara
->
id
,
kara
->
filename
);
if
(
__download_kara
(
kara
->
url
,
kara
->
filename
,
true
))
{
if
(
__download_kara
(
kara
->
url
,
kara
->
filename
,
true
))
{
LOG_WARN
(
"REPO"
,
"Could not download kara %ld at path '%s'"
,
LOG_WARN
(
"REPO"
,
"Could not download kara %ld at path '%s'"
,
kara
->
id
,
kara
->
filename
);
kara
->
id
,
kara
->
filename
);
...
@@ -396,7 +397,7 @@ __handle_got_json_internal_callback(const char *key, const char *val, int comp,
...
@@ -396,7 +397,7 @@ __handle_got_json_internal_callback(const char *key, const char *val, int comp,
++
(
kara
->
ignored_count
);
++
(
kara
->
ignored_count
);
database_update_touch
(
kara
->
db
,
kara
->
id
);
database_update_touch
(
kara
->
db
,
kara
->
id
);
database_update_set_available
(
kara
->
db
,
kara
->
id
);
database_update_set_available
(
kara
->
db
,
kara
->
id
);
LOG_DEBUG
(
"REPO"
,
"Ignore kara
'
%ld
' with path '%s'"
,
kara
->
id
,
kara
->
filename
);
LOG_DEBUG
(
"REPO"
,
"Ignore kara %ld
"
,
kara
->
id
);
return
;
return
;
}
}
...
@@ -411,7 +412,7 @@ __handle_got_json_internal_callback(const char *key, const char *val, int comp,
...
@@ -411,7 +412,7 @@ __handle_got_json_internal_callback(const char *key, const char *val, int comp,
static
inline
void
static
inline
void
__handle_got_json
(
volatile
sqlite3
*
db
,
struct
module_repo_internal
*
repo
,
const
char
*
json
)
__handle_got_json
(
volatile
sqlite3
*
db
,
struct
module_repo_internal
*
repo
,
const
char
*
json
)
{
{
size_t
len
=
json_parse_get_count
(
json
,
1
);
size_t
len
=
json_parse_get_count
(
json
,
2
);
struct
kara
kara
=
{
struct
kara
kara
=
{
.
repo
=
repo
,
.
repo
=
repo
,
.
db
=
db
,
.
db
=
db
,
...
@@ -435,7 +436,7 @@ __handle_got_json(volatile sqlite3 *db, struct module_repo_internal *repo, const
...
@@ -435,7 +436,7 @@ __handle_got_json(volatile sqlite3 *db, struct module_repo_internal *repo, const
/* Handle the json */
/* Handle the json */
LOG_INFO
(
"REPO"
,
"Starting to process json for repo %s"
,
repo
->
name
);
LOG_INFO
(
"REPO"
,
"Starting to process json for repo %s"
,
repo
->
name
);
json_parse
(
json
,
1
,
__handle_got_json_internal_callback
,
(
void
*
)
&
kara
);
json_parse
(
json
,
2
,
__handle_got_json_internal_callback
,
(
void
*
)
&
kara
);
LOG_INFO
(
"REPO"
,
"Updated %ld karas and ignored %ld karas, total is %ld"
,
LOG_INFO
(
"REPO"
,
"Updated %ld karas and ignored %ld karas, total is %ld"
,
kara
.
update_count
,
kara
.
ignored_count
,
len
);
kara
.
update_count
,
kara
.
ignored_count
,
len
);
}
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter