aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-02-08Clarify thread safety docs, rename JANSSON_THREAD_SAFEthreadsafetyPetri Lehtinen3-15/+27
2018-02-01Docs: Update information on thread safety.Corey Farrell2-17/+12
Fixes #387
2018-02-01json_dump: Fix thread safety issue.Corey Farrell3-48/+48
Circular reference detection in json_dump was not thread safe. Replace visited flag with a hashtable_t. Issue #387
2018-01-29Use thread-safe reference counting if supported by the compiler.Corey Farrell4-7/+40
This makes use of __atomic or __sync builtin compiler functions to make json_decref and json_incref thread-safe. Issue #387
2017-12-16Merge pull request #374 from coreyfarrell/always-stealPetri Lehtinen4-25/+60
json_pack: Enable more complete stealing of references.
2017-12-13apiref: Clarify documentation for unpack `O` format.Corey Farrell1-1/+4
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
2017-12-13json_object_iter_set_new: Fix error branch leak.Corey Farrell1-0/+3
This function needs to release a reference to value if the other arguments are invalid. Issue #135
2017-12-13json_pack: Enable more complete stealing of references.Corey Farrell2-24/+53
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
2017-12-13Merge pull request #375 from phniix/373_upstream_typo_in_cmakelistsPetri Lehtinen1-1/+1
Fixes akheron/jansson#373
2017-12-13Merge pull request #377 from coreyfarrell/extra-refsPetri Lehtinen1-6/+2
Remove extra reference actions in parsers.
2017-12-13Merge pull request #378 from phst/docPetri Lehtinen1-0/+10
Document that length-aware string functions have been added in 2.7
2017-12-10Document that length-aware string functions have been added in 2.7Philipp Stephani1-0/+10
2017-11-14Remove extra reference actions in parsers.Corey Farrell1-6/+2
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
2017-11-07Fixes akheron/jansson#373Joe Hura1-1/+1
'sys/time.h' is a typo, it should read: 'sys/types.h'
2017-11-07Fix a compile error on macOS clangPetri Lehtinen1-1/+1
Reported by Diederick Huijbers
2017-10-09Merge pull request #365 from phst/bug352Petri Lehtinen10-136/+283
Use last byte of error text as numeric error code
2017-10-03Use last byte of error text as numeric error codePhilipp Stephani10-136/+283
Fixes #352
2017-08-19Make json_equal() const-correctPetri Lehtinen2-9/+9
Fixes #344
2017-08-19Work around gcc's -Wimplicit-fallthroughPetri Lehtinen1-11/+11
2017-08-06Merge pull request #359 from sanjay24/masterPetri Lehtinen1-1/+3
json_dump_file API returns success even when fclose fails
2017-08-05json_dump_file API returns success even when fclose fails (consider disk ↵Sanjay Kumar1-1/+3
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.
2017-07-20Merge pull request #356 from hellojaewon/masterPetri Lehtinen1-2/+2
Docs - Fix typo
2017-07-16Fix typo최재원1-2/+2
2017-04-19Merge pull request #339 from npmccallum/optpackPetri Lehtinen3-2/+64
Enable optional object members in json_pack()
2017-04-19Enable optional object/array members in json_pack()Nathaniel McCallum3-2/+64
2017-04-13Merge commit '1b8bebf0bf8f1c0c3d92faf67a830bf8448897ed'2.10Petri Lehtinen1-1/+1
2017-04-13Allow forward declaring json_error_t valuesPetri Lehtinen1-1/+1
2017-04-12build: Use Autoconf macro @includedir@ for jansson.pc.Mathieu Lirzin1-1/+1
This is more consistent with what is done for other pkg-config variables.
2017-03-29Merge pull request #336 from akheron/issue-333Petri Lehtinen1-1/+1
CMakeLists.txt: Remove extra parenthesis
2017-03-29CMakeLists.txt: Remove extra parenthesisPetri Lehtinen1-1/+1
Fixes #333
2017-03-02jansson 2.10v2.10Nathaniel McCallum6-7/+32
2017-03-02Merge pull request #329 from npmccallum/embedPetri Lehtinen4-6/+52
Add JSON_EMBED encoding flag
2017-02-27Add JSON_EMBED encoding flagNathaniel McCallum4-6/+52
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.
2017-01-31Merge pull request #328 from npmccallum/masterPetri Lehtinen8-7/+243
Helper functions for network IO
2017-01-27Implement json_dumpfd() and json_loadfd()Nathaniel McCallum8-7/+166
The primary use of these functions is easy loading and dumping from stream sockets. Signed-off-by: Nathaniel McCallum <npmccallum@redhat.com>
2017-01-26Implement json_dumpb()Nathaniel McCallum5-0/+77
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>
2016-11-16Merge pull request #321 from quiet/masterPetri Lehtinen1-1/+1
parens for LONG_LONG_INT in cmake
2016-11-12parens for LONG_LONG_INT in cmakeBrian Armstrong1-1/+1
when this is defined as "", cmake bails with an error about arguments in if
2016-10-24Merge pull request #314 from martinlindhe/condition-always-truePetri Lehtinen1-2/+2
part of conditional expression is always true (!done)
2016-10-24Merge pull request #311 from robertmu/masterPetri Lehtinen1-1/+1
Fix passing redundant argument to error_set()
2016-10-24Merge pull request #309 from halfaleague/larger-json-buffersPetri Lehtinen1-1/+1
Allow parsing of buffers larger than 2GB on most 64 bit arch.
2016-10-19part of conditional expression is always true (!done), found with pvs-studioMartin Lindhe1-2/+2
2016-10-07Fix passing redundant argument to error_set()Robert Mu1-1/+1
2016-10-01Allow parsing of buffers larger than 2GB on most 64 bit arch.Luke Carmichael1-1/+1
size_t is usually 64 bits on most architectures -- this allows for larger .json files
2016-09-18doc: Change version to 2.10-devPetri Lehtinen1-1/+1
2016-09-18doc: Change version to 2.92.9Petri Lehtinen1-1/+1
2016-09-18jansson 2.9v2.9Petri Lehtinen6-6/+30
2016-09-18Update copyrights for 2016Petri Lehtinen41-41/+41
2016-09-16Merge branch '2.8'Petri Lehtinen1-1/+2
2016-09-16Add install targets to be optional2.8Matthew Johnston1-0/+3