On Sun, 9 Jan 2011 18:40:49 -0800 "Enlightenment SVN" <no-re...@enlightenment.org> wrote:
> Log: > svn ignores, switch to harvard site for rss, implement http 301 and 303 > > > Author: discomfitor > Date: 2011-01-09 18:40:48 -0800 (Sun, 09 Jan 2011) > New Revision: 56014 > Trac: http://trac.enlightenment.org/e/changeset/56014 > > Modified: > trunk/PROTO/azy/src/lib/azy_client.c > trunk/PROTO/azy/src/lib/azy_client_events.c trunk/PROTO/azy/src/tests/rss/ > trunk/PROTO/azy/src/tests/rss/rss.c > > Modified: trunk/PROTO/azy/src/lib/azy_client.c > =================================================================== > --- trunk/PROTO/azy/src/lib/azy_client.c 2011-01-10 01:17:12 UTC (rev > 56013) +++ trunk/PROTO/azy/src/lib/azy_client.c 2011-01-10 02:40:48 > UTC (rev 56014) @@ -269,6 +269,7 @@ > ecore_con_server_timeout_set(svr, 1); > > client->net = azy_net_new(svr); > + azy_net_header_set(client->net, "host", client->addr); > > return EINA_TRUE; > } > @@ -715,7 +716,7 @@ > * @brief Helper function to automatically handle redirection > * > * This function is used inside an AZY_CLIENT_DISCONNECTED callback to > automatically > - * reconnect to the server if necessary (HTTP 302 returned). > + * reconnect to the server if necessary (HTTP 301/302/303 returned). > * @param cli The client object (NOT #NULL) > * @return #EINA_TRUE only if reconnection has succeeded, else #EINA_FALSE > */ > @@ -735,7 +736,7 @@ > if (!net) return EINA_FALSE; > code = azy_net_code_get(net); > > - if (code == 302) > + if ((code >= 301) && (code <= 303)) > { > azy_client_connect(cli, cli->secure); > return EINA_TRUE; > > Modified: trunk/PROTO/azy/src/lib/azy_client_events.c > =================================================================== > --- trunk/PROTO/azy/src/lib/azy_client_events.c 2011-01-10 01:17:12 > UTC (rev 56013) +++ trunk/PROTO/azy/src/lib/azy_client_events.c > 2011-01-10 02:40:48 UTC (rev 56014) @@ -281,7 +281,7 @@ > azy_events_connection_kill(hd->client->net->conn, EINA_FALSE, NULL); > return; > } > - INFO("Handling HTTP 302: redirect to %s", location); > + INFO("Handling HTTP %i: redirect to %s", hd->recv->http.res.http_code, > location); next = strchr(location, '/'); > if (next && (next - location < 8)) > { > @@ -473,7 +473,7 @@ > > } > > - if (hd->recv->http.res.http_code == 302) /* ughhhh redirect */ > + if ((hd->recv->http.res.http_code >= 301) && > (hd->recv->http.res.http_code <= 303))/* ughhhh redirect */ { > _azy_client_handler_redirect(hd); > return ECORE_CALLBACK_RENEW; > @@ -613,7 +613,7 @@ > EINA_SAFETY_ON_TRUE_RETURN_VAL( > !ecore_con_server_send(client->net->conn, > eina_strbuf_string_get(hd->send), eina_strbuf_length_get(hd->send)), > ECORE_CALLBACK_CANCEL); > - printf("Sent>>>>>>>>>\n%*s\n>>>>>>>>", > eina_strbuf_length_get(hd->send), eina_strbuf_string_get(hd->send)); > + //CRI("Sent>>>>>>>>>\n%*s\n>>>>>>>>", > eina_strbuf_length_get(hd->send), eina_strbuf_string_get(hd->send)); > eina_strbuf_free(hd->send); hd->send = NULL; > } > > > Property changes on: trunk/PROTO/azy/src/tests/rss > ___________________________________________________________________ > Added: svn:ignore > + src/tests/rss/Makefile.in > src/tests/rss/rss > src/tests/rss/.deps > src/tests/rss/Makefile > > > > Modified: trunk/PROTO/azy/src/tests/rss/rss.c > =================================================================== > --- trunk/PROTO/azy/src/tests/rss/rss.c 2011-01-10 01:17:12 UTC (rev > 56013) +++ trunk/PROTO/azy/src/tests/rss/rss.c 2011-01-10 02:40:48 UTC > (rev 56014) @@ -64,15 +64,15 @@ > cli = azy_client_new(); > > EINA_SAFETY_ON_NULL_RETURN_VAL(cli, 1); > -// EINA_SAFETY_ON_TRUE_RETURN_VAL(!azy_client_host_set(cli, > "http://cyber.law.harvard.edu", 80), 1); > + EINA_SAFETY_ON_TRUE_RETURN_VAL(!azy_client_host_set(cli, > "http://cyber.law.harvard.edu", 80), 1); // > EINA_SAFETY_ON_TRUE_RETURN_VAL(!azy_client_host_set(cli, > "http://www.enlightenment.org", 80), 1); > - EINA_SAFETY_ON_TRUE_RETURN_VAL(!azy_client_host_set(cli, > "http://rss.cnn.com", 80), 1); +// > EINA_SAFETY_ON_TRUE_RETURN_VAL(!azy_client_host_set(cli, > "http://rss.cnn.com", 80), 1); > EINA_SAFETY_ON_TRUE_RETURN_VAL(!azy_client_connect(cli, EINA_FALSE), 1); > -// azy_net_uri_set(azy_client_net_get(cli), > "/rss/examples/rss2sample.xml"); > + azy_net_uri_set(azy_client_net_get(cli), "/rss/examples/rss2sample.xml"); > // azy_net_uri_set(azy_client_net_get(cli), "/rss.php?p=news&l=en"); > - azy_net_uri_set(azy_client_net_get(cli), "/rss/cnn_topstories.rss"); > +// azy_net_uri_set(azy_client_net_get(cli), "/rss/cnn_topstories.rss"); > > azy_net_version_set(azy_client_net_get(cli), 0); > > > Okay, with this commit RSS parsing in azy should be 100% functional. See src/tests/rss for an example. -- Mike Blumenkrantz Zentific: NULL pointer dereferences now 50% off! ------------------------------------------------------------------------------ Gaining the trust of online customers is vital for the success of any company that requires sensitive data to be transmitted over the Web. Learn how to best implement a security strategy that keeps consumers' information secure and instills the confidence they need to proceed with transactions. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel