Added '\r\n\r\n' delimiter to server.go error returned to the client

This commit is contained in:
Kelvin Clement Mwinuka
2024-02-14 15:59:17 +08:00
parent 323bb0bb15
commit ff2d579102

View File

@@ -208,7 +208,7 @@ func (server *Server) handleConnection(ctx context.Context, conn net.Conn) {
res, err := server.handleCommand(ctx, message, &conn, false)
if err != nil {
if _, err = w.Write([]byte(fmt.Sprintf("-Error %s", err.Error()))); err != nil {
if _, err = w.Write([]byte(fmt.Sprintf("-Error %s\r\n\r\n", err.Error()))); err != nil {
log.Println(err)
}
continue