Skip to content

Commit

Permalink
Merge pull request #163 from holmes1412/master
Browse files Browse the repository at this point in the history
support set_uri_fragment() for task
  • Loading branch information
Barenboim authored Feb 9, 2022
2 parents bfd0112 + 810c4a6 commit 4b00cbc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/rpc_task.inl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
limitations under the License.
*/

#include <stdlib.h>
#include <string.h>
#include <string>
#include <functional>
#include <workflow/WFGlobal.h>
Expand Down Expand Up @@ -111,6 +113,7 @@ public:
void set_compress_type(RPCCompressType type);
void set_retry_max(int retry_max);
void set_attachment_nocopy(const char *attachment, size_t len);
int set_uri_fragment(const std::string& fragment);
int serialize_input(const ProtobufIDLMessage *in);
int serialize_input(const ThriftIDLMessage *in);

Expand Down Expand Up @@ -335,6 +338,21 @@ inline void RPCClientTask<RPCREQ, RPCRESP>::set_attachment_nocopy(const char *at
this->req.set_attachment_nocopy(attachment, len);
}

template<class RPCREQ, class RPCRESP>
int RPCClientTask<RPCREQ, RPCRESP>::set_uri_fragment(const std::string& fragment)
{
char *str = strdup(fragment.c_str());

if (str)
{
free(this->uri_.fragment);
this->uri_.fragment = str;
return 0;
}

return -1;
}

template<class RPCREQ, class RPCRESP>
inline void RPCClientTask<RPCREQ, RPCRESP>::set_retry_max(int retry_max)
{
Expand Down

0 comments on commit 4b00cbc

Please sign in to comment.