fix SSL web-seed test
This commit is contained in:
parent
3340bbbfb4
commit
94e41538b6
|
@ -38,15 +38,30 @@ using namespace libtorrent;
|
||||||
|
|
||||||
const int proxy = libtorrent::settings_pack::none;
|
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)
|
TORRENT_TEST(url_seed)
|
||||||
{
|
{
|
||||||
for (int keepalive = 0; keepalive < 2; ++keepalive)
|
run_http_suite(proxy, "http", 1, 0, 0, 0);
|
||||||
{
|
}
|
||||||
#ifdef TORRENT_USE_OPENSSL
|
|
||||||
run_http_suite(proxy, "https", 1, 0, 0, keepalive);
|
TORRENT_TEST(url_seed_keepalive_rename)
|
||||||
#endif
|
{
|
||||||
run_http_suite(proxy, "http", 1, 0, 0, keepalive);
|
|
||||||
}
|
|
||||||
run_http_suite(proxy, "http", 1, 0, 0, 1, 1);
|
run_http_suite(proxy, "http", 1, 0, 0, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import os
|
||||||
import ssl
|
import ssl
|
||||||
import gzip
|
import gzip
|
||||||
import base64
|
import base64
|
||||||
import socket
|
|
||||||
|
|
||||||
chunked_encoding = False
|
chunked_encoding = False
|
||||||
keepalive = True
|
keepalive = True
|
||||||
|
@ -148,7 +147,7 @@ class http_handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||||
if not keepalive:
|
if not keepalive:
|
||||||
s.send_header("Connection", "close")
|
s.send_header("Connection", "close")
|
||||||
try:
|
try:
|
||||||
s.request.shutdown(socket.SHUT_RD);
|
s.request.shutdown();
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print 'Failed to shutdown read-channel of socket: ', 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.send_header("Content-Length", "0")
|
||||||
s.end_headers()
|
s.end_headers()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
port = int(sys.argv[1])
|
port = int(sys.argv[1])
|
||||||
chunked_encoding = sys.argv[2] != '0'
|
chunked_encoding = sys.argv[2] != '0'
|
||||||
|
|
Loading…
Reference in New Issue