|
@@ -45,6 +45,9 @@ static inline int rpc_dump_transaction(rpc_t* rpc, void* ctx, void *ih, ts_trans
|
|
{
|
|
{
|
|
void* vh;
|
|
void* vh;
|
|
|
|
|
|
|
|
+ if(t==NULL)
|
|
|
|
+ return -1;
|
|
|
|
+
|
|
if(rpc->struct_add(ih, "{", "Transaction", &vh)<0)
|
|
if(rpc->struct_add(ih, "{", "Transaction", &vh)<0)
|
|
{
|
|
{
|
|
rpc->fault(ctx, 500, "Internal error creating transaction struct");
|
|
rpc->fault(ctx, 500, "Internal error creating transaction struct");
|
|
@@ -73,9 +76,9 @@ static inline int rpc_dump_transaction(rpc_t* rpc, void* ctx, void *ih, ts_trans
|
|
*/
|
|
*/
|
|
static void rpc_tsilo_dump(rpc_t *rpc, void *c)
|
|
static void rpc_tsilo_dump(rpc_t *rpc, void *c)
|
|
{
|
|
{
|
|
- ts_transaction_t* trans;
|
|
|
|
- struct ts_urecord* record;
|
|
|
|
- struct ts_entry* entry;
|
|
|
|
|
|
+ ts_transaction_t* trans = NULL;
|
|
|
|
+ struct ts_urecord* record = NULL;
|
|
|
|
+ struct ts_entry* entry = NULL;
|
|
|
|
|
|
str brief = {0, 0};
|
|
str brief = {0, 0};
|
|
|
|
|
|
@@ -115,8 +118,8 @@ static void rpc_tsilo_dump(rpc_t *rpc, void *c)
|
|
|
|
|
|
/* add the entries per hash */
|
|
/* add the entries per hash */
|
|
for(i=0,n=0,max=0,ntrans=0; i<t_table->size; i++) {
|
|
for(i=0,n=0,max=0,ntrans=0; i<t_table->size; i++) {
|
|
|
|
+ lock_entry(&t_table->entries[i]);
|
|
entry = &t_table->entries[i];
|
|
entry = &t_table->entries[i];
|
|
- lock_entry(entry);
|
|
|
|
|
|
|
|
n += entry->n;
|
|
n += entry->n;
|
|
if(max<entry->n)
|
|
if(max<entry->n)
|
|
@@ -130,7 +133,7 @@ static void rpc_tsilo_dump(rpc_t *rpc, void *c)
|
|
"Hash", record->rurihash,
|
|
"Hash", record->rurihash,
|
|
"Transactions", &ih)<0)
|
|
"Transactions", &ih)<0)
|
|
{
|
|
{
|
|
- unlock_entry(entry);
|
|
|
|
|
|
+ unlock_entry(&t_table->entries[i]);
|
|
rpc->fault(c, 500, "Internal error creating ruri struct");
|
|
rpc->fault(c, 500, "Internal error creating ruri struct");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -139,13 +142,13 @@ static void rpc_tsilo_dump(rpc_t *rpc, void *c)
|
|
ntrans += 1;
|
|
ntrans += 1;
|
|
if (short_dump==0) {
|
|
if (short_dump==0) {
|
|
if (rpc_dump_transaction(rpc, c, ih, trans) == -1) {
|
|
if (rpc_dump_transaction(rpc, c, ih, trans) == -1) {
|
|
- unlock_entry(entry);
|
|
|
|
|
|
+ unlock_entry(&t_table->entries[i]);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- unlock_entry(entry);
|
|
|
|
|
|
+ unlock_entry(&t_table->entries[i]);
|
|
}
|
|
}
|
|
|
|
|
|
/* extra attributes node */
|
|
/* extra attributes node */
|