From 3df59dd9a8b3982d6c257266738b7fc3e0b311ea Mon Sep 17 00:00:00 2001 From: Dave Beckett Date: Sun, 25 Oct 2020 19:12:37 -0700 Subject: Remove callers of deprecated raptor_www setters --- src/raptor_grddl.c | 10 +++++++--- src/raptor_parse.c | 10 +++++++--- src/raptor_www_test.c | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/raptor_grddl.c b/src/raptor_grddl.c index 01dfb78f..f419164b 100644 --- a/src/raptor_grddl.c +++ b/src/raptor_grddl.c @@ -926,15 +926,19 @@ raptor_grddl_fetch_uri(raptor_parser* rdf_parser, if(!www) return 1; - raptor_www_set_user_agent(www, "grddl/0.1"); + if(raptor_www_set_user_agent2(www, "grddl/0.1", 0)) + return 1; if(flags & FETCH_ACCEPT_XSLT) { - raptor_www_set_http_accept(www, "application/xml"); + if(raptor_www_set_http_accept2(www, "application/xml", 0)) + return 1; } else { accept_h = raptor_parser_get_accept_header(rdf_parser); if(accept_h) { - raptor_www_set_http_accept(www, accept_h); + ret = raptor_www_set_http_accept2(www, accept_h, 0); RAPTOR_FREE(char*, accept_h); + if(ret) + return 1; } } if(rdf_parser->uri_filter) diff --git a/src/raptor_parse.c b/src/raptor_parse.c index 95ab2ac4..9bc0a39a 100644 --- a/src/raptor_parse.c +++ b/src/raptor_parse.c @@ -758,8 +758,10 @@ raptor_parser_parse_uri_with_connection(raptor_parser* rdf_parser, accept_h = raptor_parser_get_accept_header(rdf_parser); if(accept_h) { - raptor_www_set_http_accept2(rdf_parser->www, accept_h, 0); + ret = raptor_www_set_http_accept2(rdf_parser->www, accept_h, 0); RAPTOR_FREE(char*, accept_h); + if(ret) + return 1; } } @@ -788,8 +790,10 @@ raptor_parser_parse_uri_with_connection(raptor_parser* rdf_parser, RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL)); ua = RAPTOR_OPTIONS_GET_STRING(rdf_parser, RAPTOR_OPTION_WWW_HTTP_USER_AGENT); - if(ua) - raptor_www_set_user_agent2(rdf_parser->www, ua, 0); + if(ua) { + if(raptor_www_set_user_agent2(rdf_parser->www, ua, 0)) + return 1; + } cert_filename = RAPTOR_OPTIONS_GET_STRING(rdf_parser, RAPTOR_OPTION_WWW_CERT_FILENAME); diff --git a/src/raptor_www_test.c b/src/raptor_www_test.c index 08833723..060626fe 100644 --- a/src/raptor_www_test.c +++ b/src/raptor_www_test.c @@ -76,7 +76,7 @@ int main (int argc, char *argv[]) www = raptor_new_www(world); raptor_www_set_content_type_handler(www, write_content_type, (void*)stderr); - raptor_www_set_user_agent(www, user_agent); + raptor_www_set_user_agent2(www, user_agent, 0); /* start retrieval (always a GET) */ -- cgit v1.2.1