diff options
author | unknown <stewart@mysql.com> | 2005-02-24 17:57:22 +1100 |
---|---|---|
committer | unknown <stewart@mysql.com> | 2005-02-24 17:57:22 +1100 |
commit | 9bc6ed86cc03a094f55f6702e47b80ec4baa7778 (patch) | |
tree | 3c555a4ea52430ed6f61cbf7a269961550fd91fb /ndb/src/mgmapi/mgmapi.cpp | |
parent | bb5a2f280f41178cb132e6c0e9db205cbc4abc9f (diff) | |
download | mariadb-git-9bc6ed86cc03a094f55f6702e47b80ec4baa7778.tar.gz |
Fixes for: use initial mgm connection as transporter connection
ndb/include/mgmapi/mgmapi.h:
ndb_mgm_convert_to_transporter may destroy the handle, now takes a pointer.
ndb/include/mgmcommon/ConfigRetriever.hpp:
If outside code is going to manipulate the NdbMgmHandle, allow it to do it
via a get_mgmHandlePtr() call
ndb/include/transporter/TransporterRegistry.hpp:
connect_client and connect_ndb_mgmd may destroy the handle, now they take a pointer.
ndb/src/common/transporter/TransporterRegistry.cpp:
When start_service is binding to ports, report back the port numbers.
We need this here now, as we re-use the initial mgm connection as a transporter, which
is connected *before* start_service has allocated the dynamic port numbers. So the creation
of this early transporter cannot be used to send the dynamic ports to the mgmd.
We connect to the mgm server (using the handle that will be used in the client_Connect thread)
if needed. This is thread safe as start_service is only ever called once, before
the client connect thread starts.
connect_client,connect_ndb_mgmd may destroy the NdbMgmHandle. It now accepts a pointer to it.
ndb/src/kernel/vm/Configuration.cpp:
Copy the m_mgmd_host string from the config_retreiver as the NdbMgmHandle in the
ConfigRetreiver will be destroyed later (along with the host string).
globalTransporterRegistry.connect_client will destroy the mgm handle, use a pointer to the handle.
ndb/src/kernel/vm/Configuration.hpp:
allow the dynamic allocation of m_mgmd_host.
ndb/src/mgmapi/mgmapi.cpp:
accept a pointer for ndb_mgm_convert_to_transporter as we destroy the handle.
Diffstat (limited to 'ndb/src/mgmapi/mgmapi.cpp')
-rw-r--r-- | ndb/src/mgmapi/mgmapi.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index f326a77a8af..99b6efe320b 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -2189,21 +2189,21 @@ ndb_mgm_get_connection_int_parameter(NdbMgmHandle handle, extern "C" NDB_SOCKET_TYPE -ndb_mgm_convert_to_transporter(NdbMgmHandle handle) +ndb_mgm_convert_to_transporter(NdbMgmHandle *handle) { NDB_SOCKET_TYPE s; - CHECK_HANDLE(handle, NDB_INVALID_SOCKET); - CHECK_CONNECTED(handle, NDB_INVALID_SOCKET); + CHECK_HANDLE((*handle), NDB_INVALID_SOCKET); + CHECK_CONNECTED((*handle), NDB_INVALID_SOCKET); - handle->connected= 0; // we pretend we're disconnected - s= handle->socket; + (*handle)->connected= 0; // we pretend we're disconnected + s= (*handle)->socket; SocketOutputStream s_output(s); s_output.println("transporter connect"); s_output.println(""); - ndb_mgm_destroy_handle(&handle); // set connected=0, so won't disconnect + ndb_mgm_destroy_handle(handle); // set connected=0, so won't disconnect return s; } |