Commit graph

260 commits

Author SHA1 Message Date
Janus
097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00
SomberNight
5f050aa13e
follow-up prev 2018-06-22 18:32:01 +02:00
SomberNight
5220451b73
fix #4457 2018-06-22 18:01:55 +02:00
Neil
e0a6b082d2 First message on an interface is server.version (#4407)
- Use server.ping to ping (valid as of protocol version 1.2) rather
  than server.version (deprecated as a ping)
- Ping every 5 mins rather than every 1 minute.  By default servers
  don't consider a connection stale until 10 minutes of inactivity.
- Remove unused last_request member of interface

Port of c3f26e59db
2018-06-05 12:41:41 +02:00
SomberNight
c8bed8791a
assert datadir available 2018-04-29 18:25:10 +02:00
Dimitris Apostolou
989c9c2b55 Fix typos 2018-04-15 20:34:40 +02:00
ThomasV
ad6dd73a03 do not catch OSError in pipe.send (fix ANR on some versions of Android) 2018-04-05 11:27:12 +02:00
SomberNight
9b7536e75c use explicit utf-8 encoding when opening files in text mode 2018-03-23 21:47:51 +01:00
ThomasV
4137ae94a0 flush certificate file; might fix #4059 2018-03-13 15:07:19 +01:00
SomberNight
08aee6a857 logging - use self.print_error instead of util.print_error 2018-03-09 14:58:13 +01:00
fr3aker
b7d587c6ac
fix parsing of ipv6 addresses in interface 2017-11-20 20:17:58 +01:00
Justin Turner Arthur
9a0aa9b478 Remove Python 2 support imports. 2017-11-13 02:26:48 -06:00
SomberNight
07e9415c2d interface ssl: besides TLS 1.1, also allow later versions 2017-11-10 21:39:20 +01:00
ThomasV
1cbc794229 interface: catch py3 exceptions 2017-10-25 17:43:30 +02:00
ThomasV
216e9403be cleanup six (no python2 support) 2017-09-04 14:43:31 +02:00
ThomasV
4df5997940 catch wrap_socket timeouts 2017-08-26 08:28:25 +02:00
ThomasV
1a6e41cec8 python3 updates 2017-08-26 08:28:24 +02:00
fr3aker
8a15581d8e fix imports 2017-08-26 08:28:24 +02:00
Dmitry Sorokin
d304ccdf17 py3 in qtgui 2017-08-26 08:27:47 +02:00
Dmitry Sorokin
5be78950ca py3 2017-08-26 08:27:47 +02:00
ThomasV
7daa8ebfdd interface: close wire is response is not dict 2017-02-01 13:59:07 +01:00
ThomasV
29e2570d3d prevent busy looping 2017-01-09 16:36:05 +01:00
ThomasV
d61ccd4275 throttle send_requests 2016-11-09 13:23:10 +01:00
ThomasV
5661aabaa4 revert to daemon for interface code 2016-06-11 16:11:36 +02:00
ThomasV
5f3b6af2e0 interface: do not use daemon threads 2016-06-04 12:58:49 +02:00
ThomasV
d3a9af9e79 catch exception in interface.close 2016-03-10 15:38:24 +01:00
ThomasV
a0b861cd8f fix bug in interface.get_responses 2016-03-05 12:37:11 +01:00
ThomasV
305843999e Relicensing 2016-02-24 10:20:30 +01:00
ThomasV
fe9ec6de06 reformatting 2016-01-26 13:51:47 +01:00
ThomasV
614f3df4b8 Revert "Use ssl.PROTOCOL_TLSv1 on client side to avoid SSLv23"
This reverts commit 4731418af9.
2015-10-27 10:44:36 +01:00
Kefkius
f329143733 Fix typo in Connection docstring
Fix a small typo in Connection docstring.
2015-10-06 16:03:24 -04:00
Neil Booth
6f1367fea6 Unify message IDs between network and interfaces
Previously network.py had its own idea of request IDs,
and each interface had its own which was sent on the wire.
The interface would jump through hoops to translate one
to the other.

This unifies them so that a message ID is passed when
queueing a request, in addition to the method and params.
network.py is now solely responsible for message ID management.

Apart from being simpler and clearer, this also should be faster
as there is much less data structure manipulation and rebuilding
happening.
2015-09-09 21:00:25 +09:00
Neil Booth
93b99ebded Handy new class PrintError
Saves adding "def print_error" to endless classes.
2015-09-06 21:40:00 +09:00
Neil Booth
cdcd4d7215 Fix 'tuple' object has no attribute 'copy'
Occurred when switching interfaces and there were unanswered
requests that need resending.  This bug isn't new; it's been
there since at least 3rd June.
2015-09-02 11:56:53 +09:00
Neil Booth
748662dede Add a debugging traceback. 2015-08-31 14:38:19 +09:00
Neil Booth
49a48d52ac Use select. 2015-08-22 14:03:08 +02:00
ThomasV
85d9b8aa8d fix: dePem cert before parsing 2015-08-07 11:58:59 +02:00
ThomasV
ca3c320ef4 simplify x509 constructor 2015-08-07 11:39:30 +02:00
ThomasV
476d198be9 fix missing occurences of X509.parse 2015-08-04 18:31:08 +02:00
ThomasV
380bccacf0 request_queue.put should never block, because maxsize is not set 2015-07-31 20:11:12 +02:00
Eagle[TM]
4731418af9 Use ssl.PROTOCOL_TLSv1 on client side to avoid SSLv23 2015-07-30 20:40:05 +02:00
Roman Zeyde
5fbd7553ed interface: fix check_host_name() pattern matching
The existing pattern matching code:

    val.find('*.') == 0 and name.find(val[1:]) + len(val[1:]) == len(name)

will return True in the following case:

   val = '*.host.com'
   name = 'blah.org'

since string.find() will return -1, len(val[1:]) == 9 and len(name) == 8.
2015-07-26 18:11:30 +03:00
neocogent
8792301846 restrict to *. only, add DN support also 2015-07-17 11:17:43 +07:00
neocogent
3c563b85ad adjust comment about wildcards 2015-07-17 04:22:39 +07:00
neocogent
59c231808f add wildcard ssl support 2015-07-17 04:03:40 +07:00
Roman Zeyde
9c06bee8c7 interface: slow_parse() is not defined for X509 2015-07-01 16:54:11 +03:00
ThomasV
604d5d432c sanitize server at the interface level (follow up to issue #1330) 2015-07-01 09:09:00 +02:00
Neil Booth
2f2e468d0a SocketPipe shouldn't close the socket.
This is a layering violation - the SocketPipe doesn't own
the socket and provides no other way to close the socket, leading
to unnecessary complexity like that in interface.py.

I looked at deamon.py and NetworkProxy - the two other users,
and they don't close the sockets explicitly, just let them be
garbage collected.
2015-06-04 16:30:59 +09:00
Neil Booth
ab2f80c3e0 Fix couple of minor socket issues
Set timeout and socket options on all simple sockets.  At present
some code paths can miss it, such as when the SSL certificate is
CA-signed.

Add a missing check for failure.
2015-06-02 18:13:36 +09:00
Neil Booth
76355e66c8 Make interface status tri-state.
This allows us to distinguish between connecting and connected
state in interface.py (used to be done in network.py but that
had other issues).

This means we don't switch to a connecting server, and get_interfaces()
does not report connecting ones.
2015-06-01 18:22:03 +09:00