mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
raop: use pw_strip to string header values
This commit is contained in:
parent
fa20fb2e80
commit
78bfdd1717
1 changed files with 2 additions and 10 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue