Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Commit 0066af8

Browse files
lthHerman Lee
authored andcommitted
Add net functions to exported functions for semisync client
Summary: Semisync clients need a way to ack binlog events, and this is currently done by directly using net_* functions. Differential Revision: D7518790
1 parent 2022de7 commit 0066af8

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

‎include/mysql_com.h‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,11 +1102,25 @@ enum enum_session_state_type {
11021102
bool my_net_init(struct NET *net, MYSQL_VIO vio);
11031103
void my_net_local_init(struct NET *net);
11041104
void net_end(struct NET *net);
1105+
// extern "C" since it is part of the libmysql ABI.
1106+
#ifdef __cplusplus
1107+
extern "C" {
1108+
#endif
11051109
void net_clear(struct NET *net, bool check_buffer);
1110+
#ifdef __cplusplus
1111+
}
1112+
#endif
11061113
void net_claim_memory_ownership(struct NET *net, bool claim);
11071114
bool net_realloc(struct NET *net, size_t length);
1115+
// extern "C" since it is part of the libmysql ABI.
1116+
#ifdef __cplusplus
1117+
extern "C" {
1118+
#endif
11081119
bool net_flush(struct NET *net);
11091120
bool my_net_write(struct NET *net, const unsigned char *packet, size_t len);
1121+
#ifdef __cplusplus
1122+
}
1123+
#endif
11101124
bool net_write_command(struct NET *net, unsigned char command,
11111125
const unsigned char *header, size_t head_len,
11121126
const unsigned char *packet, size_t len);

‎libmysql/CMakeLists.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ SET(CLIENT_API_FUNCTIONS
154154
mysql_take_ssl_context_ownership
155155
cli_safe_read
156156
cli_safe_read_nonblocking
157+
net_flush
158+
net_clear
159+
my_net_write
157160

158161
CACHE INTERNAL "Functions exported by client API"
159162
)

0 commit comments

Comments
 (0)