Age | Commit message (Collapse) | Author | Files | Lines |
|
Fixes #392
|
|
Atomic references and thread safe json_dump
|
|
Clarify thread safety docs, rename JANSSON_THREAD_SAFE
|
|
|
|
Fixes #387
|
|
Circular reference detection in json_dump was not thread safe. Replace
visited flag with a hashtable_t.
Issue #387
|
|
This makes use of __atomic or __sync builtin compiler functions to make
json_decref and json_incref thread-safe.
Issue #387
|
|
json_pack: Enable more complete stealing of references.
|
|
The `O` format causes reference counts to increase, but in an error they
are not released. Callers to unpack functions that use the `O` format
should use pointers pre-initialized to NULL so they can safely release
the reference on error.
Also corrected typo which said this was like `O` (itself).
Fixes #135
|
|
This function needs to release a reference to value if the other
arguments are invalid.
Issue #135
|
|
Users of the "o" format have an expectation that the object reference
will be stolen. Any error causes the collection process to end early.
This patch causes json_pack and related functions to continue scanning
the format and parameters so all references can be stolen to prevent
leaks. This makes no attempt to continue processing if the format
string is broken or missing.
'make check' still passes. Ran test_pack under valgrind and verified
that the leaked reference is fixed. Added a test which uses refcounts
to verify that the reference was correctly stolen after a NULL value
error.
Issue #135
|
|
Fixes akheron/jansson#373
|
|
Remove extra reference actions in parsers.
|
|
Document that length-aware string functions have been added in 2.7
|
|
|
|
Make parse_object use json_object_set_new_nocheck and make parse_array
use json_array_append_new, remove json_decref from error and success
paths.
Fixes #376
|
|
'sys/time.h' is a typo, it should read: 'sys/types.h'
|
|
Reported by Diederick Huijbers
|
|
Use last byte of error text as numeric error code
|
|
Fixes #352
|
|
Fixes #344
|
|
|
|
json_dump_file API returns success even when fclose fails
|
|
full case). API should check the return value of fclose before returning success to its caller. fwrite may not write anything into the file, it simply returns the number of bytes written into the buffer. When disk is full and fclose is called, it results in truncation of the file (resulting in zero sized file). Since, API is returning success, its caller can't take any remedial action on its failure.
|
|
Docs - Fix typo
|
|
|
|
Enable optional object members in json_pack()
|
|
|
|
|
|
|
|
This is more consistent with what is done for other pkg-config
variables.
|
|
CMakeLists.txt: Remove extra parenthesis
|
|
Fixes #333
|
|
|
|
Add JSON_EMBED encoding flag
|
|
The JSON_EMBED encoding flag causes the opening and closing characters
of the top-level array ('[', ']') or object ('{', '}') to be omitted
during encoding. This feature makes it possible to concatenate multiple
arrays or objects in the stream output. It also makes it possible to
perform outputs of partial composes.
One such example of a partial compose is when outputting a JWE object.
The output is a JSON object. But it has one top-level attribute
("ciphertext") that can grow out of proportion with the rest of the
metadata. With the JSON_EMBED flag, the other metadata can be composed
ahead of time and dumped during the beginning of output, where the
"ciphertext" and "tag" attributes can be streamed out in chunks. Thus,
the header material can be composed with Jansson and the ciphertext
itself can be composed manually.
|
|
Helper functions for network IO
|
|
The primary use of these functions is easy loading
and dumping from stream sockets.
Signed-off-by: Nathaniel McCallum <npmccallum@redhat.com>
|
|
This function encodes the json_t object to a pre-allocated buffer.
It compliments the already existing json_loadb() function and is
useful for parsing JSON-RPC (among other protocols) when sent over
datagram sockets.
Signed-off-by: Nathaniel McCallum <npmccallum@redhat.com>
|
|
parens for LONG_LONG_INT in cmake
|
|
when this is defined as "", cmake bails with an error about arguments in
if
|
|
part of conditional expression is always true (!done)
|
|
Fix passing redundant argument to error_set()
|
|
Allow parsing of buffers larger than 2GB on most 64 bit arch.
|
|
|
|
|
|
size_t is usually 64 bits on most architectures -- this allows for larger .json files
|
|
|
|
|
|
|