From 7ec1121cc832086f533dd0adfcb581e16c1e312d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 8 Apr 2013 23:30:21 +0200 Subject: uri: convert to C++ --- Makefile.am | 11 +--- src/DatabaseCommands.cxx | 2 +- src/DecoderThread.cxx | 2 +- src/InputStream.cxx | 5 +- src/OtherCommands.cxx | 2 +- src/PlaylistAny.cxx | 5 +- src/PlaylistCommands.cxx | 5 +- src/PlaylistEdit.cxx | 2 +- src/PlaylistFile.cxx | 5 +- src/PlaylistMapper.cxx | 5 +- src/PlaylistRegistry.cxx | 5 +- src/PlaylistSave.cxx | 5 +- src/PlaylistSong.cxx | 2 +- src/QueueCommands.cxx | 5 +- src/QueueSave.cxx | 5 +- src/SongPrint.cxx | 5 +- src/SongUpdate.cxx | 2 +- src/TagFile.cxx | 6 +- src/UpdateWalk.cxx | 5 +- src/decoder/GmeDecoderPlugin.cxx | 5 +- src/decoder/VorbisDecoderPlugin.cxx | 2 +- src/ls.cxx | 6 +- src/playlist/PlsPlaylistPlugin.cxx | 1 - src/playlist/XspfPlaylistPlugin.cxx | 1 - src/uri.c | 114 ------------------------------------ src/uri.h | 60 ------------------- src/util/UriUtil.cxx | 113 +++++++++++++++++++++++++++++++++++ src/util/UriUtil.hxx | 58 ++++++++++++++++++ 28 files changed, 195 insertions(+), 249 deletions(-) delete mode 100644 src/uri.c delete mode 100644 src/uri.h create mode 100644 src/util/UriUtil.cxx create mode 100644 src/util/UriUtil.hxx diff --git a/Makefile.am b/Makefile.am index 0b5d46c45..5e3dbb3c8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -99,7 +99,6 @@ mpd_headers = \ src/tag_id3.h \ src/tag_rva2.h \ src/tokenizer.h \ - src/uri.h \ src/utils.h \ src/string_util.h \ src/timer.h \ @@ -246,7 +245,6 @@ src_mpd_SOURCES = \ src/tokenizer.c \ src/TextFile.cxx src/TextFile.hxx \ src/text_input_stream.c \ - src/uri.c \ src/utils.c \ src/string_util.c \ src/Volume.cxx src/Volume.hxx \ @@ -292,6 +290,7 @@ endif # Generic utility library libutil_a_SOURCES = \ + src/util/UriUtil.cxx src/util/UriUtil.hxx \ src/util/Manual.hxx \ src/util/RefCount.hxx \ src/util/fifo_buffer.c src/util/fifo_buffer.h \ @@ -1088,6 +1087,7 @@ test_run_input_LDADD = \ $(INPUT_LIBS) \ $(ARCHIVE_LIBS) \ libconf.a \ + libutil.a \ libevent.a \ libfs.a \ $(GLIB_LIBS) @@ -1096,7 +1096,6 @@ test_run_input_SOURCES = test/run_input.cxx \ src/IOThread.cxx \ src/tokenizer.c src/utils.c src/string_util.c\ src/Tag.cxx src/TagNames.c src/TagPool.cxx src/TagSave.cxx \ - src/uri.c \ src/fd_util.c if ENABLE_ARCHIVE @@ -1105,6 +1104,7 @@ test_visit_archive_LDADD = \ $(INPUT_LIBS) \ $(ARCHIVE_LIBS) \ libconf.a \ + libutil.a \ libevent.a \ libfs.a \ $(GLIB_LIBS) @@ -1113,7 +1113,6 @@ test_visit_archive_SOURCES = test/visit_archive.cxx \ src/InputStream.cxx \ src/tokenizer.c src/utils.c src/string_util.c \ src/Tag.cxx src/TagNames.c src/TagPool.cxx \ - src/uri.c \ src/fd_util.c if ENABLE_DESPOTIFY @@ -1136,7 +1135,6 @@ test_dump_text_file_SOURCES = test/dump_text_file.cxx \ src/tokenizer.c src/utils.c src/string_util.c\ src/Tag.cxx src/TagNames.c src/TagPool.cxx \ src/text_input_stream.c \ - src/uri.c \ src/fd_util.c test_dump_playlist_LDADD = \ @@ -1155,7 +1153,6 @@ test_dump_playlist_SOURCES = test/dump_playlist.cxx \ $(DECODER_SRC) \ src/IOThread.cxx \ src/tokenizer.c src/utils.c src/string_util.c\ - src/uri.c \ src/Song.cxx src/Tag.cxx src/TagNames.c src/TagPool.cxx src/TagSave.cxx \ src/tag_handler.c src/TagFile.cxx \ src/audio_check.c src/pcm_buffer.c \ @@ -1186,7 +1183,6 @@ test_run_decoder_SOURCES = test/run_decoder.cxx \ src/tokenizer.c src/utils.c src/string_util.c \ src/Tag.cxx src/TagNames.c src/TagPool.cxx src/tag_handler.c \ src/ReplayGainInfo.cxx \ - src/uri.c \ src/fd_util.c \ src/audio_check.c \ src/audio_format.c \ @@ -1211,7 +1207,6 @@ test_read_tags_SOURCES = test/read_tags.cxx \ src/tokenizer.c src/utils.c src/string_util.c \ src/Tag.cxx src/TagNames.c src/TagPool.cxx src/tag_handler.c \ src/ReplayGainInfo.cxx \ - src/uri.c \ src/fd_util.c \ src/audio_check.c \ $(DECODER_SRC) diff --git a/src/DatabaseCommands.cxx b/src/DatabaseCommands.cxx index bd5a48b35..039bfefed 100644 --- a/src/DatabaseCommands.cxx +++ b/src/DatabaseCommands.cxx @@ -26,7 +26,7 @@ #include "CommandError.hxx" #include "ClientInternal.hxx" #include "tag.h" -#include "uri.h" +#include "util/UriUtil.hxx" #include "SongFilter.hxx" #include "protocol/Result.hxx" diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx index b7b0bf78c..18bbad6df 100644 --- a/src/DecoderThread.cxx +++ b/src/DecoderThread.cxx @@ -31,10 +31,10 @@ #include "tag.h" #include "InputStream.hxx" #include "DecoderList.hxx" +#include "util/UriUtil.hxx" extern "C" { #include "replay_gain_ape.h" -#include "uri.h" } #include diff --git a/src/InputStream.cxx b/src/InputStream.cxx index 913fcf637..c079b4961 100644 --- a/src/InputStream.cxx +++ b/src/InputStream.cxx @@ -22,10 +22,7 @@ #include "InputRegistry.hxx" #include "InputPlugin.hxx" #include "input/RewindInputPlugin.hxx" - -extern "C" { -#include "uri.h" -} +#include "util/UriUtil.hxx" #include #include diff --git a/src/OtherCommands.cxx b/src/OtherCommands.cxx index 4909f37f5..07fbc8442 100644 --- a/src/OtherCommands.cxx +++ b/src/OtherCommands.cxx @@ -33,9 +33,9 @@ #include "protocol/Result.hxx" #include "ls.hxx" #include "Volume.hxx" +#include "util/UriUtil.hxx" extern "C" { -#include "uri.h" #include "stats.h" } diff --git a/src/PlaylistAny.cxx b/src/PlaylistAny.cxx index 3f6733f0b..a34333df8 100644 --- a/src/PlaylistAny.cxx +++ b/src/PlaylistAny.cxx @@ -21,12 +21,9 @@ #include "PlaylistAny.hxx" #include "PlaylistMapper.hxx" #include "PlaylistRegistry.hxx" +#include "util/UriUtil.hxx" #include "input_stream.h" -extern "C" { -#include "uri.h" -} - #include static struct playlist_provider * diff --git a/src/PlaylistCommands.cxx b/src/PlaylistCommands.cxx index dc3b3e0de..e3b5ad5f8 100644 --- a/src/PlaylistCommands.cxx +++ b/src/PlaylistCommands.cxx @@ -32,10 +32,7 @@ #include "protocol/Result.hxx" #include "ls.hxx" #include "Playlist.hxx" - -extern "C" { -#include "uri.h" -} +#include "util/UriUtil.hxx" #include #include diff --git a/src/PlaylistEdit.cxx b/src/PlaylistEdit.cxx index df38c3da1..9ccc8c46d 100644 --- a/src/PlaylistEdit.cxx +++ b/src/PlaylistEdit.cxx @@ -26,9 +26,9 @@ #include "config.h" #include "Playlist.hxx" #include "PlayerControl.hxx" +#include "util/UriUtil.hxx" extern "C" { -#include "uri.h" #include "song.h" } diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx index a879f70a0..662c4de96 100644 --- a/src/PlaylistFile.cxx +++ b/src/PlaylistFile.cxx @@ -32,10 +32,7 @@ #include "Idle.hxx" #include "fs/Path.hxx" #include "fs/FileSystem.hxx" - -extern "C" { -#include "uri.h" -} +#include "util/UriUtil.hxx" #include #include diff --git a/src/PlaylistMapper.cxx b/src/PlaylistMapper.cxx index 85f47e44b..08131106d 100644 --- a/src/PlaylistMapper.cxx +++ b/src/PlaylistMapper.cxx @@ -23,10 +23,7 @@ #include "PlaylistRegistry.hxx" #include "Mapper.hxx" #include "fs/Path.hxx" - -extern "C" { -#include "uri.h" -} +#include "util/UriUtil.hxx" #include diff --git a/src/PlaylistRegistry.cxx b/src/PlaylistRegistry.cxx index 6dc94034e..d764a2ec2 100644 --- a/src/PlaylistRegistry.cxx +++ b/src/PlaylistRegistry.cxx @@ -32,10 +32,7 @@ #include "playlist/CuePlaylistPlugin.hxx" #include "playlist/EmbeddedCuePlaylistPlugin.hxx" #include "input_stream.h" - -extern "C" { -#include "uri.h" -} +#include "util/UriUtil.hxx" #include "string_util.h" #include "conf.h" diff --git a/src/PlaylistSave.cxx b/src/PlaylistSave.cxx index 6ca6740fc..473713d5d 100644 --- a/src/PlaylistSave.cxx +++ b/src/PlaylistSave.cxx @@ -26,10 +26,7 @@ #include "Idle.hxx" #include "fs/Path.hxx" #include "fs/FileSystem.hxx" - -extern "C" { -#include "uri.h" -} +#include "util/UriUtil.hxx" #include diff --git a/src/PlaylistSong.cxx b/src/PlaylistSong.cxx index 4df4d22d4..4ca955240 100644 --- a/src/PlaylistSong.cxx +++ b/src/PlaylistSong.cxx @@ -25,10 +25,10 @@ #include "ls.hxx" #include "tag.h" #include "fs/Path.hxx" +#include "util/UriUtil.hxx" extern "C" { #include "song.h" -#include "uri.h" } #include diff --git a/src/QueueCommands.cxx b/src/QueueCommands.cxx index 4a3e1312d..aac6d5a51 100644 --- a/src/QueueCommands.cxx +++ b/src/QueueCommands.cxx @@ -31,10 +31,7 @@ #include "protocol/ArgParser.hxx" #include "protocol/Result.hxx" #include "ls.hxx" - -extern "C" { -#include "uri.h" -} +#include "util/UriUtil.hxx" #include diff --git a/src/QueueSave.cxx b/src/QueueSave.cxx index 09b0645f8..6311201e9 100644 --- a/src/QueueSave.cxx +++ b/src/QueueSave.cxx @@ -25,10 +25,7 @@ #include "DatabasePlugin.hxx" #include "DatabaseGlue.hxx" #include "TextFile.hxx" - -extern "C" { -#include "uri.h" -} +#include "util/UriUtil.hxx" #include diff --git a/src/SongPrint.cxx b/src/SongPrint.cxx index 126e5b9f4..331f3912d 100644 --- a/src/SongPrint.cxx +++ b/src/SongPrint.cxx @@ -25,10 +25,7 @@ #include "TagPrint.hxx" #include "Mapper.hxx" #include "Client.hxx" - -extern "C" { -#include "uri.h" -} +#include "util/UriUtil.hxx" #include diff --git a/src/SongUpdate.cxx b/src/SongUpdate.cxx index 186512ffe..dde2ad57a 100644 --- a/src/SongUpdate.cxx +++ b/src/SongUpdate.cxx @@ -21,9 +21,9 @@ extern "C" { #include "song.h" -#include "uri.h" } +#include "util/UriUtil.hxx" #include "Directory.hxx" #include "Mapper.hxx" #include "fs/Path.hxx" diff --git a/src/TagFile.cxx b/src/TagFile.cxx index 046778bd2..3cc4c0f54 100644 --- a/src/TagFile.cxx +++ b/src/TagFile.cxx @@ -19,11 +19,7 @@ #include "config.h" #include "TagFile.hxx" - -extern "C" { -#include "uri.h" -} - +#include "util/UriUtil.hxx" #include "DecoderList.hxx" #include "decoder_plugin.h" #include "input_stream.h" diff --git a/src/UpdateWalk.cxx b/src/UpdateWalk.cxx index 9a2e87d56..1d26e0ebd 100644 --- a/src/UpdateWalk.cxx +++ b/src/UpdateWalk.cxx @@ -34,10 +34,7 @@ #include "conf.h" #include "fs/Path.hxx" #include "fs/FileSystem.hxx" - -extern "C" { -#include "uri.h" -} +#include "util/UriUtil.hxx" #include diff --git a/src/decoder/GmeDecoderPlugin.cxx b/src/decoder/GmeDecoderPlugin.cxx index b778f68b1..9693dd32b 100644 --- a/src/decoder/GmeDecoderPlugin.cxx +++ b/src/decoder/GmeDecoderPlugin.cxx @@ -22,10 +22,7 @@ #include "decoder_api.h" #include "audio_check.h" #include "tag_handler.h" - -extern "C" { -#include "uri.h" -} +#include "util/UriUtil.hxx" #include #include diff --git a/src/decoder/VorbisDecoderPlugin.cxx b/src/decoder/VorbisDecoderPlugin.cxx index 488786ed8..822714c4e 100644 --- a/src/decoder/VorbisDecoderPlugin.cxx +++ b/src/decoder/VorbisDecoderPlugin.cxx @@ -23,10 +23,10 @@ #include "decoder_api.h" #include "InputStream.hxx" #include "OggCodec.hxx" +#include "util/UriUtil.hxx" extern "C" { #include "audio_check.h" -#include "uri.h" } #include "tag_handler.h" diff --git a/src/ls.cxx b/src/ls.cxx index 9bb56c898..ef3fe2a84 100644 --- a/src/ls.cxx +++ b/src/ls.cxx @@ -19,11 +19,7 @@ #include "config.h" #include "ls.hxx" - -extern "C" { -#include "uri.h" -} - +#include "util/UriUtil.hxx" #include "Client.hxx" #include diff --git a/src/playlist/PlsPlaylistPlugin.cxx b/src/playlist/PlsPlaylistPlugin.cxx index 3cf5f46e5..faa7212f3 100644 --- a/src/playlist/PlsPlaylistPlugin.cxx +++ b/src/playlist/PlsPlaylistPlugin.cxx @@ -21,7 +21,6 @@ #include "PlsPlaylistPlugin.hxx" #include "MemoryPlaylistProvider.hxx" #include "input_stream.h" -#include "uri.h" #include "song.h" #include "tag.h" diff --git a/src/playlist/XspfPlaylistPlugin.cxx b/src/playlist/XspfPlaylistPlugin.cxx index bd84d86b7..0484246e3 100644 --- a/src/playlist/XspfPlaylistPlugin.cxx +++ b/src/playlist/XspfPlaylistPlugin.cxx @@ -21,7 +21,6 @@ #include "XspfPlaylistPlugin.hxx" #include "MemoryPlaylistProvider.hxx" #include "input_stream.h" -#include "uri.h" #include "tag.h" #include diff --git a/src/uri.c b/src/uri.c deleted file mode 100644 index 2a0ca6ca6..000000000 --- a/src/uri.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2003-2011 The Music Player Daemon Project - * http://www.musicpd.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "config.h" -#include "uri.h" - -#include - -#include -#include - -bool uri_has_scheme(const char *uri) -{ - return strstr(uri, "://") != NULL; -} - -/* suffixes should be ascii only characters */ -const char * -uri_get_suffix(const char *uri) -{ - const char *suffix = strrchr(uri, '.'); - if (suffix == NULL) - return NULL; - - ++suffix; - - if (strpbrk(suffix, "/\\") != NULL) - return NULL; - - return suffix; -} - -static const char * -verify_uri_segment(const char *p) -{ - const char *q; - - unsigned dots = 0; - while (*p == '.') { - ++p; - ++dots; - } - - if (dots <= 2 && (*p == 0 || *p == '/')) - return NULL; - - q = strchr(p + 1, '/'); - return q != NULL ? q : ""; -} - -bool -uri_safe_local(const char *uri) -{ - while (true) { - uri = verify_uri_segment(uri); - if (uri == NULL) - return false; - - if (*uri == 0) - return true; - - assert(*uri == '/'); - - ++uri; - } -} - -char * -uri_remove_auth(const char *uri) -{ - const char *auth, *slash, *at; - char *p; - - if (strncmp(uri, "http://", 7) == 0) - auth = uri + 7; - else if (strncmp(uri, "https://", 8) == 0) - auth = uri + 8; - else - /* unrecognized URI */ - return NULL; - - slash = strchr(auth, '/'); - if (slash == NULL) - slash = auth + strlen(auth); - - at = memchr(auth, '@', slash - auth); - if (at == NULL) - /* no auth info present, do nothing */ - return NULL; - - /* duplicate the full URI and then delete the auth - information */ - p = g_strdup(uri); - memmove(p + (auth - uri), p + (at + 1 - uri), - strlen(at)); - - return p; -} diff --git a/src/uri.h b/src/uri.h deleted file mode 100644 index 6713f1698..000000000 --- a/src/uri.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2003-2011 The Music Player Daemon Project - * http://www.musicpd.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef MPD_URI_H -#define MPD_URI_H - -#include "gcc.h" - -#include - -/** - * Checks whether the specified URI has a scheme in the form - * "scheme://". - */ -gcc_pure -bool uri_has_scheme(const char *uri); - -gcc_pure -const char * -uri_get_suffix(const char *uri); - -/** - * Returns true if this is a safe "local" URI: - * - * - non-empty - * - does not begin or end with a slash - * - no double slashes - * - no path component begins with a dot - */ -gcc_pure -bool -uri_safe_local(const char *uri); - -/** - * Removes HTTP username and password from the URI. This may be - * useful for displaying an URI without disclosing secrets. Returns - * NULL if nothing needs to be removed, or if the URI is not - * recognized. - */ -gcc_malloc -char * -uri_remove_auth(const char *uri); - -#endif diff --git a/src/util/UriUtil.cxx b/src/util/UriUtil.cxx new file mode 100644 index 000000000..4b0cec11b --- /dev/null +++ b/src/util/UriUtil.cxx @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2003-2013 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "UriUtil.hxx" + +#include + +#include +#include + +bool uri_has_scheme(const char *uri) +{ + return strstr(uri, "://") != nullptr; +} + +/* suffixes should be ascii only characters */ +const char * +uri_get_suffix(const char *uri) +{ + const char *suffix = strrchr(uri, '.'); + if (suffix == nullptr) + return nullptr; + + ++suffix; + + if (strpbrk(suffix, "/\\") != nullptr) + return nullptr; + + return suffix; +} + +static const char * +verify_uri_segment(const char *p) +{ + const char *q; + + unsigned dots = 0; + while (*p == '.') { + ++p; + ++dots; + } + + if (dots <= 2 && (*p == 0 || *p == '/')) + return nullptr; + + q = strchr(p + 1, '/'); + return q != nullptr ? q : ""; +} + +bool +uri_safe_local(const char *uri) +{ + while (true) { + uri = verify_uri_segment(uri); + if (uri == nullptr) + return false; + + if (*uri == 0) + return true; + + assert(*uri == '/'); + + ++uri; + } +} + +char * +uri_remove_auth(const char *uri) +{ + const char *auth, *slash, *at; + char *p; + + if (strncmp(uri, "http://", 7) == 0) + auth = uri + 7; + else if (strncmp(uri, "https://", 8) == 0) + auth = uri + 8; + else + /* unrecognized URI */ + return nullptr; + + slash = strchr(auth, '/'); + if (slash == nullptr) + slash = auth + strlen(auth); + + at = (const char *)memchr(auth, '@', slash - auth); + if (at == nullptr) + /* no auth info present, do nothing */ + return nullptr; + + /* duplicate the full URI and then delete the auth + information */ + p = g_strdup(uri); + memmove(p + (auth - uri), p + (at + 1 - uri), + strlen(at)); + + return p; +} diff --git a/src/util/UriUtil.hxx b/src/util/UriUtil.hxx new file mode 100644 index 000000000..1d288ca1d --- /dev/null +++ b/src/util/UriUtil.hxx @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2003-2013 The Music Player Daemon Project + * http://www.musicpd.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPD_URI_UTIL_HXX +#define MPD_URI_UTIL_HXX + +#include "gcc.h" + +/** + * Checks whether the specified URI has a scheme in the form + * "scheme://". + */ +gcc_pure +bool uri_has_scheme(const char *uri); + +gcc_pure +const char * +uri_get_suffix(const char *uri); + +/** + * Returns true if this is a safe "local" URI: + * + * - non-empty + * - does not begin or end with a slash + * - no double slashes + * - no path component begins with a dot + */ +gcc_pure +bool +uri_safe_local(const char *uri); + +/** + * Removes HTTP username and password from the URI. This may be + * useful for displaying an URI without disclosing secrets. Returns + * NULL if nothing needs to be removed, or if the URI is not + * recognized. + */ +gcc_malloc +char * +uri_remove_auth(const char *uri); + +#endif -- cgit v1.2.3