1
0

2 Commits fa85944542 ... d85df1b67b

Autor SHA1 Mensagem Data
  scossu d85df1b67b Avoid clash with lsup_rdf core.h header. há 9 meses atrás
  scossu 9df4872bc0 Fix segfault when updating non-existing resource. há 9 meses atrás
7 ficheiros alterados com 10 adições e 6 exclusões
  1. 1 1
      Makefile
  2. 1 0
      TODO.md
  3. 1 1
      include/desc.h
  4. 0 0
      include/repo_core.h
  5. 0 0
      include/resource.h
  6. 6 3
      src/desc.c
  7. 1 1
      src/repo_core.c

+ 1 - 1
Makefile

@@ -79,7 +79,7 @@ $(DYN_DBG_LIB): $(DBG_OBJ)
 
 # Debug objects.
 %_dbg.o: %.c
-	$(CC) $(CFLAGS) $(DBG_CFLAGS) $(LDFLAGS) -c $^ -o $@
+	$(CC) $(CFLAGS) $(DBG_CFLAGS) $(DBG_LDFLAGS) -c $^ -o $@
 
 
 install: lib ## Install default libraries to $PREFIX. May require sudo.

+ 1 - 0
TODO.md

@@ -10,6 +10,7 @@
 - *P* Data resource back end (disk)
 - *P* Checksum
   - *P* BLAKE2
+  - *P* BLAKE3
   - *P* SHA256
 - *P* Structures
   - *P* Sets

+ 1 - 1
include/desc.h

@@ -10,7 +10,7 @@
 #ifndef _LSR_DESC_H
 #define _LSR_DESC_H
 
-#include "core.h"
+#include "repo_core.h"
 
 
 /*

+ 0 - 0
include/core.h → include/repo_core.h


+ 0 - 0
include/resource.h


+ 6 - 3
src/desc.c

@@ -129,7 +129,8 @@ LSUP_rc
 LSR_desc_store (const LSR_Desc *rsrc)
 {
     LSR_Desc *old_rsrc;
-    PRCCK (LSR_desc_get (rsrc->id, &old_rsrc));
+    LSUP_rc rc = LSR_desc_get (rsrc->id, &old_rsrc);
+    PRCCK (rc);
 
     /*
      * BEGIN txn
@@ -137,7 +138,7 @@ LSR_desc_store (const LSR_Desc *rsrc)
     void *txn;
     LSUP_store_begin (LSR_store, 0, &txn);
     // Remove all existing user graphs.
-    if (old_rsrc) {
+    if (rc == LSUP_OK) {
         // TODO Handle managed preds and types.
         // TODO Handle conflict between disjoint managed types.
         // TODO Retain created and created_by.
@@ -162,7 +163,7 @@ LSR_desc_store (const LSR_Desc *rsrc)
 
     LSUP_Graph *tmp_gr;
     // Add new triples.
-    LSUP_rc rc = LSUP_NOACTION;
+    rc = LSUP_NOACTION;
     for (size_t i = 0; rsrc->user_data[i] != NULL; i++) {
         tmp_gr = LSUP_graph_new (
                 LSR_store, LSUP_graph_uri (rsrc->user_data[i]), NULL);
@@ -350,6 +351,8 @@ LSR_desc_update (
     for (size_t i = 0; i < ct; i++) {
         LSUP_Term *gr_uri = LSUP_graph_uri (add_data[i]);
 
+        log_debug ("Adding graph #%lu with uri: %s", i, gr_uri->data);
+
         LSUP_Term *rel_uri = LSUP_iriref_relative (rsrc_uri, gr_uri);
         if (strstr (rel_uri->data, "#__") == rel_uri->data) {
             log_error ("Fragment URI cannot start with double underscore.");

+ 1 - 1
src/core.c → src/repo_core.c

@@ -1,4 +1,4 @@
-#include "core.h"
+#include "repo_core.h"
 
 
 bool LSR_is_init = false;