File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1169,12 +1169,19 @@ impl Conn {
1169
1169
Ok ( self )
1170
1170
}
1171
1171
1172
- async fn register_as_slave ( & mut self , server_id : u32 ) -> Result < ( ) > {
1172
+ async fn register_as_slave < ' a > (
1173
+ & mut self ,
1174
+ server_id : u32 ,
1175
+ hostname : impl Into < Cow < ' a , [ u8 ] > > ,
1176
+ port : u16 ,
1177
+ ) -> Result < ( ) > {
1173
1178
use mysql_common:: packets:: ComRegisterSlave ;
1174
1179
1180
+ let cmd_register_slave = ComRegisterSlave :: new ( server_id)
1181
+ . with_hostname ( hostname)
1182
+ . with_port ( port) ;
1175
1183
self . query_drop ( "SET @master_binlog_checksum='ALL'" ) . await ?;
1176
- self . write_command ( & ComRegisterSlave :: new ( server_id) )
1177
- . await ?;
1184
+ self . write_command ( & cmd_register_slave) . await ?;
1178
1185
1179
1186
// Server will respond with OK.
1180
1187
self . read_packet ( ) . await ?;
@@ -1183,7 +1190,8 @@ impl Conn {
1183
1190
}
1184
1191
1185
1192
async fn request_binlog ( & mut self , request : BinlogRequest < ' _ > ) -> Result < ( ) > {
1186
- self . register_as_slave ( request. server_id ( ) ) . await ?;
1193
+ self . register_as_slave ( request. server_id ( ) , request. hostname_raw ( ) , request. port ( ) )
1194
+ . await ?;
1187
1195
self . write_command ( & request. as_cmd ( ) ) . await ?;
1188
1196
Ok ( ( ) )
1189
1197
}
You can’t perform that action at this time.
0 commit comments