summaryrefslogtreecommitdiffstats
path: root/plugin/handler_socket/libhsclient/hstcpcli.hpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
commit3f619478f796eddbba6e39502fe941b285dd97b1 (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /plugin/handler_socket/libhsclient/hstcpcli.hpp
parentInitial commit. (diff)
downloadmariadb-3f619478f796eddbba6e39502fe941b285dd97b1.tar.xz
mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'plugin/handler_socket/libhsclient/hstcpcli.hpp')
-rw-r--r--plugin/handler_socket/libhsclient/hstcpcli.hpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/plugin/handler_socket/libhsclient/hstcpcli.hpp b/plugin/handler_socket/libhsclient/hstcpcli.hpp
new file mode 100644
index 00000000..fa0d4db1
--- /dev/null
+++ b/plugin/handler_socket/libhsclient/hstcpcli.hpp
@@ -0,0 +1,62 @@
+
+// vim:sw=2:ai
+
+/*
+ * Copyright (C) 2010 DeNA Co.,Ltd.. All rights reserved.
+ * See COPYRIGHT.txt for details.
+ */
+
+#ifndef DENA_HSTCPCLI_HPP
+#define DENA_HSTCPCLI_HPP
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <string>
+#include <memory>
+
+#include "config.hpp"
+#include "socket.hpp"
+#include "string_ref.hpp"
+#include "string_buffer.hpp"
+
+namespace dena {
+
+struct hstcpcli_filter {
+ string_ref filter_type;
+ string_ref op;
+ size_t ff_offset;
+ string_ref val;
+ hstcpcli_filter() : ff_offset(0) { }
+};
+
+struct hstcpcli_i;
+typedef std::auto_ptr<hstcpcli_i> hstcpcli_ptr;
+
+struct hstcpcli_i {
+ virtual ~hstcpcli_i() = default;
+ virtual void close() = 0;
+ virtual int reconnect() = 0;
+ virtual bool stable_point() = 0;
+ virtual void request_buf_auth(const char *secret, const char *typ) = 0;
+ virtual void request_buf_open_index(size_t pst_id, const char *dbn,
+ const char *tbl, const char *idx, const char *retflds,
+ const char *filflds = 0) = 0;
+ virtual void request_buf_exec_generic(size_t pst_id, const string_ref& op,
+ const string_ref *kvs, size_t kvslen, uint32_t limit, uint32_t skip,
+ const string_ref& mod_op, const string_ref *mvs, size_t mvslen,
+ const hstcpcli_filter *fils = 0, size_t filslen = 0,
+ int invalues_keypart = -1, const string_ref *invalues = 0,
+ size_t invalueslen = 0) = 0; // FIXME: too long
+ virtual int request_send() = 0;
+ virtual int response_recv(size_t& num_flds_r) = 0;
+ virtual const string_ref *get_next_row() = 0;
+ virtual void response_buf_remove() = 0;
+ virtual int get_error_code() = 0;
+ virtual std::string get_error() = 0;
+ static hstcpcli_ptr create(const socket_args& args);
+};
+
+};
+
+#endif
+