fix SSL web-seed test

This commit is contained in:
arvidn 2015-07-16 00:44:03 -04:00
parent 3340bbbfb4
commit 94e41538b6
2 changed files with 23 additions and 10 deletions

View File

@ -38,15 +38,30 @@ using namespace libtorrent;
const int proxy = libtorrent::settings_pack::none;
#ifdef TORRENT_USE_OPENSSL
TORRENT_TEST(url_seed_ssl_keepalive)
{
run_http_suite(proxy, "https", 1, 0, 0, 1);
}
TORRENT_TEST(url_seed_ssl)
{
run_http_suite(proxy, "https", 1, 0, 0, 0);
}
#endif
TORRENT_TEST(url_seed_keepalive)
{
run_http_suite(proxy, "http", 1, 0, 0, 1);
}
TORRENT_TEST(url_seed)
{
for (int keepalive = 0; keepalive < 2; ++keepalive)
{
#ifdef TORRENT_USE_OPENSSL
run_http_suite(proxy, "https", 1, 0, 0, keepalive);
#endif
run_http_suite(proxy, "http", 1, 0, 0, keepalive);
}
run_http_suite(proxy, "http", 1, 0, 0, 0);
}
TORRENT_TEST(url_seed_keepalive_rename)
{
run_http_suite(proxy, "http", 1, 0, 0, 1, 1);
}

View File

@ -7,7 +7,6 @@ import os
import ssl
import gzip
import base64
import socket
chunked_encoding = False
keepalive = True
@ -148,7 +147,7 @@ class http_handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
if not keepalive:
s.send_header("Connection", "close")
try:
s.request.shutdown(socket.SHUT_RD);
s.request.shutdown();
except Exception, e:
print 'Failed to shutdown read-channel of socket: ', e
@ -175,7 +174,6 @@ class http_handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
s.send_header("Content-Length", "0")
s.end_headers()
if __name__ == '__main__':
port = int(sys.argv[1])
chunked_encoding = sys.argv[2] != '0'