You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
char *addr = *(String::Utf8Value(addrVal->ToString()));
int port = portVal->Int32Value();
as_config_add_host(&asConfig, addr, port);
The code is plain and simple. But we have a problem. char *addr is on stack and released on function exit. Why aerospike C client cannot make a deep copy of the hostname if it needs it for long time? The following code solve the problem, but is ugly:
char *addr = *(String::Utf8Value(addrVal->ToString()));
int port = portVal->Int32Value();
as_config_add_host(&asConfig, strdup(addr), port);
The text was updated successfully, but these errors were encountered:
Currently we expect as_config setup to immediately precede an aerospike_connect() call. And within the aerospike_connect() call, a deep copy of the host address is made.
Can you describe a situation where the configuration setup is not in the same scope as the connect call? And we will consider making the deep copy earlier.
we've considered this, and currently have opted for easier api of not requiring a config_destroy().
Regarding additional crashes, we have made extensive fixes, including the up coming release. Please do let us know if there are additional issues you hit, and we will do our best to address them. Thanks.
The following code make core dump:
The code is plain and simple. But we have a problem. char *addr is on stack and released on function exit. Why aerospike C client cannot make a deep copy of the hostname if it needs it for long time? The following code solve the problem, but is ugly:
The text was updated successfully, but these errors were encountered: