-
Notifications
You must be signed in to change notification settings - Fork 7
client: fix method call
and assertion in response data decoder
#113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or 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
Trailing whitespaces are forbidden by any codestyle, so the commit removes them. Also, they can become annoying because some IDEs can automatically remove them turning diff of a patch into a mess.
The function simply returns passed arguments, just like echo. Let's call it with more convenient name that doesn't have anything in common with benchmarks to use it in tests later. Part of tarantool#108
All connection methods do not wrap keys and tuples into arrays - it's responsibility of user to follow IPROTO format. The only exception is method `call` (by mistake, I believe) - it wraps arguments into array and it doesn't allow to pass raw MsgPack to this method since `mpp::as_raw` tag does not work with any other tags. The commit makes method `call` work like other methods - it won't wrap `args` by itself anymore. Closes tarantool#108
After decoding response data we check if the decoder advanced the iterator to the end of the raw data. However, that's not true when someone tries to decode data with non-matching format. The commit fixes the assertion - we should check iterator only if data was successfully decoded. Closes tarantool#99
Ignoring clang-format suggestions as they don't conform similar places in the file: git clang-format upstream/master --diff
diff --git a/src/Client/RequestEncoder.hpp b/src/Client/RequestEncoder.hpp
index 2752d3b..3fd8800 100644
--- a/src/Client/RequestEncoder.hpp
+++ b/src/Client/RequestEncoder.hpp
@@ -316,9 +316,9 @@ RequestEncoder<BUFFER>::encodeCall(const std::string &func, const T &args)
m_Buf.write('\xce');
m_Buf.write(uint32_t{0});
encodeHeader(Iproto::CALL);
- mpp::encode(m_Buf, mpp::as_map(std::forward_as_tuple(
- MPP_AS_CONST(Iproto::FUNCTION_NAME), func,
- MPP_AS_CONST(Iproto::TUPLE), args)));
+ mpp::encode(m_Buf,
+ mpp::as_map(std::forward_as_tuple(MPP_AS_CONST(Iproto::FUNCTION_NAME), func,
+ MPP_AS_CONST(Iproto::TUPLE), args)));
uint32_t request_size = (m_Buf.end() - request_start) - PREHEADER_SIZE;
++request_start;
request_start.set(__builtin_bswap32(request_size));
diff --git a/test/ClientTest.cpp b/test/ClientTest.cpp
index 0fdde8c..2bedbb5 100644
--- a/test/ClientTest.cpp
+++ b/test/ClientTest.cpp
@@ -588,7 +588,7 @@ single_conn_call(Connector<BUFFER, NetProvider> &client)
const static char *return_multi = "remote_multi";
const static char *return_nil = "remote_nil";
const static char *return_map = "remote_map";
- const static char *echo = "remote_echo";
+ const static char *echo = "remote_echo";
Connection<Buf_t, NetProvider> conn(client);
int rc = test_connect(client, conn, localhost, port); |
mkostoevr
approved these changes
Mar 28, 2025
CuriousGeorgiy
approved these changes
Mar 29, 2025
GitHub Actions does not support `macos-12` anymore - let's replace it with the newer `macos-15` version. What's about sanitizers - let's run them on `macos-14`, neither the newest nor the oldest MacOS version.
Fixed CI (removed outdated |
CuriousGeorgiy
approved these changes
Mar 31, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See commits for details.
Closes #99
Closes #108