Intermittent issue fetching https urls
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=7126
Reported by Tobias Liin liin@roxen.com
For some https urls, intermittently, Protocols.HTTP.Query.async_fetch() fails to fetch them:
Failed to close SSL connection: Broken pipe
tmp/pike/roxen/server-5.4.66/pike/lib/modules/SSL.pmod/sslfile.pike:619: SSL.sslfile(0)->close(UNDEFINED,UNDEFINED,UNDEFINED)
tmp/pike/roxen/server-5.4.66/pike/lib/modules/Protocols.pmod/HTTP.pmod/Query.pike:169: Protocols.HTTP.Query(200 OK)->close_connection()
tmp/pike/roxen/server-5.4.66/pike/lib/modules/Protocols.pmod/HTTP.pmod/Query.pike:385: Protocols.HTTP.Query(200 OK)->async_fetch_close()
-:1: Pike.Backend(0)->`()(3600.0)
The following test code can be used to trigger the problem. The same file when uploaded to kld-racing.se (roxen cms 5.0.449) works perfectly. With direktpress.roxen.com (roxen cms 5.4.66) fails pretty much on every attempt.
//string url = "https://www.kld-racing.se/atom.xml";
string url = "https://direktpress.roxen.com/atom.xml";
void http_ok(mixed con) {
write("http_ok()\n");
con->async_fetch(http_got_data);
}
void http_done() {
write("http_done()\n");
}
void http_got_data(mixed con) {
write("http_got_data()\n");
string data = con->data();
write("-------\n%O\n---------\n", data[sizeof(data)-10..]);
}
int main() {
mixed con = Protocols.HTTP.Query();
con->set_callbacks(http_ok, http_done, url);
Protocols.HTTP.do_async_method("GET", url, UNDEFINED, ([]), con);
return -1;
}