new macro to check if a URI is a valid http or https URI.
authorDan Winship <danw@src.gnome.org>
Mon, 25 Aug 2008 13:53:41 +0000 (13:53 +0000)
committerDan Winship <danw@src.gnome.org>
Mon, 25 Aug 2008 13:53:41 +0000 (13:53 +0000)
commitf0705a82524d16d862c943597bd5da0a64c4b9bb
tree9a2f55b0908b070a3cc39db10865a37c92c70e80
parent599d68b3d3ac84897b4638b430b5eda8b0efb4c9
new macro to check if a URI is a valid http or https URI.

* libsoup/soup-uri.h (SOUP_URI_VALID_FOR_HTTP): new macro to check
if a URI is a valid http or https URI.

* libsoup/soup-uri.c (soup_uri_new_with_base): Update http/https
check to use SOUP_URI_VALID_FOR_HTTP().

* libsoup/soup-session.c (redirect_handler): Check
SOUP_URI_VALID_FOR_HTTP() and call it an error if the check fails.

* libsoup/soup-message.c (soup_message_new): Remove the uri->host
check from here. Update docs to clarify that @uri must be an
http/https URI.
(soup_message_new_from_uri): Check SOUP_URI_VALID_FOR_HTTP().
Update docs.
(soup_message_set_uri): Check SOUP_URI_VALID_FOR_HTTP(). Update
docs.

Should prevent the crash in #528882, but there's still something
going wrong there at a higher level.

svn path=/trunk/; revision=1155
ChangeLog
libsoup/soup-message.c
libsoup/soup-session.c
libsoup/soup-uri.c
libsoup/soup-uri.h