raop: use pw_strip to string header values

This commit is contained in:
Wim Taymans 2022-09-26 09:31:55 +02:00
parent fa20fb2e80
commit 78bfdd1717

View file

@ -307,23 +307,15 @@ static void process_received_message(struct pw_rtsp_client *client)
static int process_header(struct pw_rtsp_client *client, char *buf)
{
if (strlen(buf) > 0) {
char *key = buf, *value, *end;
size_t len;
char *key = buf, *value;
value = strstr(buf, ":");
if (value == NULL)
return -EPROTO;
*value++ = '\0';
while (*value == ' ')
value++;
len = strlen(value);
if (len > 0) {
end = value + len - 1;
while (*end == ' ')
*end-- = '\0';
}
value = pw_strip(value, " ");
pw_properties_set(client->headers, key, value);
}