mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-28 08:05:56 -05:00
[http] Align indentation with the rest of the code
This commit is contained in:
parent
8f899f2051
commit
617a0992d0
62
src/http.c
62
src/http.c
@ -464,18 +464,18 @@ http_stream_setup(char **stream, const char *url)
|
|||||||
while ((ch = *pos) != '\0')
|
while ((ch = *pos) != '\0')
|
||||||
{
|
{
|
||||||
if (ch == '?' || ch == '#')
|
if (ch == '?' || ch == '#')
|
||||||
break;
|
break;
|
||||||
if (ch == '.')
|
if (ch == '.')
|
||||||
ext = pos;
|
ext = pos;
|
||||||
++pos;
|
++pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ext)
|
if (ext)
|
||||||
{
|
{
|
||||||
if (strncasecmp(ext, ".m3u", 4) == 0)
|
if (strncasecmp(ext, ".m3u", 4) == 0)
|
||||||
pl_format = PLAYLIST_M3U;
|
pl_format = PLAYLIST_M3U;
|
||||||
else if (strncasecmp(ext, ".pls", 4) == 0)
|
else if (strncasecmp(ext, ".pls", 4) == 0)
|
||||||
pl_format = PLAYLIST_PLS;
|
pl_format = PLAYLIST_PLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pl_format==PLAYLIST_UNK)
|
if (pl_format==PLAYLIST_UNK)
|
||||||
@ -515,45 +515,45 @@ http_stream_setup(char **stream, const char *url)
|
|||||||
{
|
{
|
||||||
// Skip comments and blank lines without counting for the limit
|
// Skip comments and blank lines without counting for the limit
|
||||||
if (pl_format == PLAYLIST_M3U && (line[0] == '#' || line[0] == '\0'))
|
if (pl_format == PLAYLIST_M3U && (line[0] == '#' || line[0] == '\0'))
|
||||||
goto line_done;
|
goto line_done;
|
||||||
|
|
||||||
n++;
|
n++;
|
||||||
|
|
||||||
if (pl_format == PLAYLIST_PLS && !in_playlist)
|
if (pl_format == PLAYLIST_PLS && !in_playlist)
|
||||||
{
|
{
|
||||||
if (strncasecmp(line, "[playlist]", strlen("[playlist]")) == 0)
|
if (strncasecmp(line, "[playlist]", strlen("[playlist]")) == 0)
|
||||||
{
|
{
|
||||||
in_playlist = true;
|
in_playlist = true;
|
||||||
n = 0;
|
n = 0;
|
||||||
}
|
}
|
||||||
goto line_done;
|
goto line_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pl_format == PLAYLIST_PLS)
|
if (pl_format == PLAYLIST_PLS)
|
||||||
{
|
{
|
||||||
pos = line;
|
pos = line;
|
||||||
while (*pos == ' ')
|
while (*pos == ' ')
|
||||||
++pos;
|
++pos;
|
||||||
|
|
||||||
// We are only interested in `FileN=http://foo/bar.mp3` entries
|
// We are only interested in `FileN=http://foo/bar.mp3` entries
|
||||||
if (strncasecmp(pos, "file", strlen("file")) != 0)
|
if (strncasecmp(pos, "file", strlen("file")) != 0)
|
||||||
goto line_done;
|
goto line_done;
|
||||||
|
|
||||||
while (*pos != '=' && *pos != '\0')
|
while (*pos != '=' && *pos != '\0')
|
||||||
++pos;
|
++pos;
|
||||||
|
|
||||||
if (*pos == '\0')
|
if (*pos == '\0')
|
||||||
goto line_done;
|
goto line_done;
|
||||||
|
|
||||||
++pos;
|
++pos;
|
||||||
while (*pos == ' ')
|
while (*pos == ' ')
|
||||||
++pos;
|
++pos;
|
||||||
|
|
||||||
// allocate the value part and proceed as with m3u
|
// allocate the value part and proceed as with m3u
|
||||||
pos = strdup(pos);
|
pos = strdup(pos);
|
||||||
free(line);
|
free(line);
|
||||||
line = (char *) pos;
|
line = (char *) pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncasecmp(line, "http://", strlen("http://")) == 0)
|
if (strncasecmp(line, "http://", strlen("http://")) == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user