Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Do not use Soup.Status.get_phrase #333

@spaetz

Description

@spaetz

Hi, Debian fails to build from source
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993088

../../src/Services/Network.vala:69.19-69.40: error: The name `get_phrase' does not exist in the context of `Soup.Status' (libsoup-2.4)
	    var reason = Soup.Status.get_phrase (code);
	                 ^^^^^^^^^^^^^^^^^^^^^^

I don't know why that code is not available, according to the API docs it should be. However, the docs describe the API as
**"There is no reason for you to ever use this function."** (https://valadoc.org/libsoup-2.4/Soup.Status.get_phrase.html).

Instead "you should just look at the message's reason_phrase". Given that the function network.describe_error() is only used twice, it should be easy to replace it:

  1. var error = network.describe_error (code);

    instead of network.describe_error (code), we can use the msg that is available in that function. and

  2. ecb ((int32) status, describe_error ((int32) status));

same, we also have the message available in that function and can use the "reason_phrase". This brings tootle in line with the recommended API as per the libsoup authors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions