Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Possible issue in Message.cs #77

Open
mjwills opened this issue Aug 24, 2016 · 0 comments
Open

Possible issue in Message.cs #77

mjwills opened this issue Aug 24, 2016 · 0 comments

Comments

@mjwills
Copy link

mjwills commented Aug 24, 2016

I am very new to this codebase, but this code seems odd to me in Message.cs:

        /// <summary>
        /// Try to show the payload as decoded to UTF-8.
        /// </summary>
        /// <returns>The decoded payload as string.</returns>
        public override string ToString()
        {
            var sb = new StringBuilder();
            sb.Append("Magic: ");
            sb.Append(this.Magic);
            if (this.Magic == 1)
            {
                sb.Append(", Attributes: ");
                sb.Append(this.Attributes);
            }

            sb.Append(", topic: ");
            try
            {
                sb.Append(Encoding.UTF8.GetString(this.Payload));
            }
            catch (Exception)
            {
                sb.Append("n/a");
            }

            return sb.ToString();
        }

Specifically the code that inserts topic: {payload} . (i.e. the label implies it is the topic, but in fact it shows the payload not the topic).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant