merged RC_1_2 into RC_2_0

This commit is contained in:
Arvid Norberg
2020-12-22 13:27:27 +01:00
6 changed files with 7 additions and 93 deletions

View File

@ -196,42 +196,6 @@ jobs:
b2 -j2 debug-iterators=on invariant-checks=full asserts=on picker-debugging=on
python:
name: Python bindings
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2.3.3
with:
submodules: recursive
- name: update package lists
continue-on-error: true
run: |
sudo apt update
- name: install boost
run: |
sudo apt install libboost-tools-dev libboost-python-dev libboost-dev libboost-system-dev
echo "using gcc ;" >>~/user-config.jam
echo "using python ;" >>~/user-config.jam
- name: install python
run: |
sudo apt install python3
- name: build python module
run: |
cd bindings/python
b2 -j2 stage_module stage_dependencies
- name: run python tests
run: |
cd bindings/python
LD_LIBRARY_PATH=./dependencies python3 test.py
dist:
name: build dist
runs-on: ubuntu-20.04

View File

@ -81,31 +81,3 @@ jobs:
- name: build library
run: |
b2 ${{ matrix.config }} -j2 -l400 warnings-as-errors=on cxxstd=14
python:
name: Python bindings
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v2.3.3
with:
submodules: recursive
- name: install boost
run: |
brew install boost-build boost boost-python3 python@3.9
export PYTHON_INCLUDE=`echo /usr/local/Cellar/python@3.9/*/Frameworks/Python.framework/Versions/3.9/include/python3.9` ;
echo "using darwin ;" >>~/user-config.jam
echo "using python : 3.9 : /usr/local/opt/python@3.9/bin/python3 : $(PYTHON_INCLUDE) : /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/config-3.9-darwin : <target-os>darwin ;" >> ~/user-config.jam
- name: build python module
run: |
cd bindings/python
b2 -j2 stage_module stage_dependencies
- name: run python tests
run: |
cd bindings/python
DYLD_LIBRARY_PATH=./dependencies python3 test.py

View File

@ -1,5 +1,9 @@
name: Python bindings
on: [push, pull_request]
on:
push:
branches: [ RC_1_2 RC_2_0 master ]
pull_request:
jobs:
build:

View File

@ -1,7 +1,6 @@
import os
import shutil
import hashlib
from random import shuffle
import struct
import random
@ -204,7 +203,7 @@ for i in range(256):
mixes = []
for i in range(200):
shuffle(messages)
random.shuffle(messages)
mixes.append(b''.join(messages[1:20]))
messages += mixes

View File

@ -436,32 +436,9 @@ namespace libtorrent { namespace {
#endif
return;
}
static time_point global_last = min_time();
int const num_peers = m_torrent.num_peers();
if (num_peers <= 1) return;
// don't send pex messages more often than 1 every 100 ms, and
// allow pex messages to be sent 5 seconds apart if there isn't
// contention
int const delay = std::min(std::max(60000 / num_peers, 100), 3000);
if (now - milliseconds(delay) < global_last)
{
#ifndef TORRENT_DISABLE_LOGGING
// m_pc.peer_log(peer_log_alert::info, "PEX", "global-wait: %d"
// , int(total_seconds(milliseconds(delay) - (now - global_last))));
#endif
return;
}
// this will allow us to catch up, even if our timer
// has lower resolution than delay
if (global_last == min_time())
global_last = now;
else
global_last += milliseconds(delay);
m_last_msg = now;
if (m_first_time)

View File

@ -59,9 +59,7 @@ def substitute_file(name):
elif 'VERSION=' in line and name.endswith('Makefile'):
line = 'VERSION=%d.%d.%d\n' % (version[0], version[1], version[2])
elif 'version=' in line and name.endswith('setup.py'):
line = " version=\"%d.%d.%d\",\n" % (version[0], version[1], version[2])
elif "version = '" in line and name.endswith('setup.py'):
line = " version=\"%d.%d.%d\",\n" % (version[0], version[1], version[2])
line = ' version="%d.%d.%d",\n' % (version[0], version[1], version[2])
elif '"-LT' in line and name.endswith('settings_pack.cpp'):
line = re.sub('"-LT[0-9A-Za-z]{4}-"', '"-LT%c%c%c%c-"' % v(version), line)