-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce CBOR format support for REST payloads (#169)
* Squashed 'libs/tinycbor/' content from commit d2dd95c git-subtree-dir: libs/tinycbor git-subtree-split: d2dd95cb8841d88d5a801e3ef9c328fd6200e7bd * add tinycbor library to the project With this commit CMake will add the tinycbor files to the sources to be compiled into the driver. CMake will exclude two files: - open_memstream.c that won't be compiled by MSVC (WITHOUT_OPEN_MEMSTREAM compilation flag doesn't exclude its source); - cborparser.c that will be copied (and patched) under the building folder. The patching of the later file above adds one function that allows copy-free extraction of text/byte strings. * introduce CBOR format support for REST payloads This commit adds basic support for CBOR encapsulation, as an alternative to JSON. The format to use is connection-specific and configured in the connection string. The introduction stops short of supporting encoding/decoding of the parameters and result sets values: it will allow building a non-parameterized query and decoding the response object (either with a result-set or with an error), but without unpacking the values in the result set of the latter. Server version querying is also carried over CBOR. All communication is done either over JSON or CBOR, although the driver will carry on if it receives a JSON response to a CBOR request (or the other way around). However, driver-generated "fake" responses to catalog queries are always JSON-formatted (makes maintenance of text responses easier). The commit also enhances the support of the Elasticsearch-formatted errors (both JSON and CBOR) in that the "error" parameter will be parsed if of a map type (generally an ES/SQL error) or passed on as is, if of a string type. The previous behavior was to abandon parsing if "error" wasn't a map and present the entire error answer to the user; this wouldn't work well with a CBOR object now. * fix a copy&paste define error - the define is not yet used, though. * add the legal files for tinycbor as 3rd party lib. - add to the repo the files necessary to generate the legal notices and reports. * addressing PR review comments - reducing code duplication on srv. version checking; - fixing a couple of comment typos; - assigning const strings to named vars. (cherry picked from commit 992f0e0)
- Loading branch information
Showing
77 changed files
with
13,316 additions
and
536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
name,version,revision,url,license,copyright | ||
tinycbor,,d2dd95c,https://github.com/intel/tinycbor.git,MIT,Copyright (c) 2017 Intel Corporation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Intel Corporation | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.