Any particular reason to not use sds for hostname? It would've eliminated the strlen calls when computing the message size.

Originally posted by @PingXie in https://github.com/redis/redis/pull/9530#discussion_r795141268

Comment From: PingXie

@madolson let me know if you are OK with me taking over this bug. Happy to help out some more.

Comment From: madolson

@PingXie Sorry, I thumbed up the response since it made sense to me. Feel free to implement it.

Comment From: PingXie

No worries :-) Will do