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)
|
static int process_header(struct pw_rtsp_client *client, char *buf)
|
||||||
{
|
{
|
||||||
if (strlen(buf) > 0) {
|
if (strlen(buf) > 0) {
|
||||||
char *key = buf, *value, *end;
|
char *key = buf, *value;
|
||||||
size_t len;
|
|
||||||
|
|
||||||
value = strstr(buf, ":");
|
value = strstr(buf, ":");
|
||||||
if (value == NULL)
|
if (value == NULL)
|
||||||
return -EPROTO;
|
return -EPROTO;
|
||||||
|
|
||||||
*value++ = '\0';
|
*value++ = '\0';
|
||||||
while (*value == ' ')
|
|
||||||
value++;
|
|
||||||
|
|
||||||
len = strlen(value);
|
value = pw_strip(value, " ");
|
||||||
if (len > 0) {
|
|
||||||
end = value + len - 1;
|
|
||||||
while (*end == ' ')
|
|
||||||
*end-- = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
pw_properties_set(client->headers, key, value);
|
pw_properties_set(client->headers, key, value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue