Commit Graph

39 Commits (5f955ba52f10c6167e82ec870cbb327a6ca1de2d)

Author SHA1 Message Date
Dmitri Bogomolov d6c1845b71
Moved Peer from state to network.node
and trustedPeer to network.connectionpool.BMConnectionPool attribute
4 years ago
Dmitri Bogomolov 341651973a
Reduced imports:
- exported from network package all objects used outside;
  - made all threads available in threads module.

Wrote some module docstrings.
4 years ago
Dmitri Bogomolov 7a89109fc9
New logging approach in order to reduce imports from submodules
and use logging without risk of circular import. Only subpackage
that imports from debug is bitmessageqt - because it also uses
debug.resetLogging().
Instead of from debug import logger is now recommended to use:

import logging

logger = logging.getLogger('default')

All subclasses of StoppableThread now have a logger attribute.
All threading related stuff except for set_thread_name()
was moved from helper_threading to network.threads.

Fixed two my mistakes from previous edit of debug in a1a8d3a:

 - logger.handlers is not dict but iterable
 - sys.excepthook should be set unconditionally
4 years ago
Dmitri Bogomolov ad2a2b3fb4
Inherit helper_threading.StoppableThread from threading.Thread
and do random.seed() in its __init__
4 years ago
Dmitri Bogomolov 92c0196887
Add self peer into knownnodes if detected external IP with UPnP 4 years ago
Dmitri Bogomolov c5ce2e36d5
shared.extPort is obsolete 4 years ago
coffeedogs 0bceeca524
Changes based on style and lint checks. (final_code_quality_5) 5 years ago
Peter Šurda 140265621f
UPnP parser fix
- Fixes #1131
- Came over BM, thank you kind stranger
6 years ago
Peter Šurda 96ea36cfd2
UPnP client port randomize 6 years ago
Peter Šurda cc955cd69d
Try new ports of binding fails
- API and BM protocol will try random ports for binding if those
configured are occupied
6 years ago
Peter Šurda 42246f83ef
Reset connection list on UPnP
- reset the already attempted connection list after UPnP port mapping is
  established. This allows to resubmit externally reachable port
7 years ago
Peter Šurda e15d9e3e03
Save UPnP externa port after creating mapping 7 years ago
Peter Šurda 6062277d60
Rename configparser.py to bmconfigparser.py
- it was causing problems with py2app because the source of python's own
  CongigParser is also configparser.py
7 years ago
Peter Šurda 59f3a2fbe7
Reduce cyclic dependencies
- rearranged code to reduce cyclic dependencies
- doCleanShutdown is separated in shutdown.py
- shared queues are separated in queues.py
- some default values were moved to defaults.py
- knownnodes partially moved to knownnodes.py
7 years ago
Peter Šurda ad75552b5c
Move shutdown from shared.py to state.py 7 years ago
Peter Šurda c738d93056
Assorted fixes
- landscape.io was complaining, this fixes most easily fixable errors
7 years ago
Peter Šurda 8bcfe80ad0
Refactoring of config parser and shared.py
- got rid of shared config parser and made it into a singleton
- refactored safeConfigGetBoolean as a method of the config singleton
- refactored safeConfigGet as a method of the config singleton
- moved softwareVersion from shared.py into version.py
- moved some global variables from shared.py into state.py
- moved some protocol-specific functions from shared.py into protocol.py
7 years ago
Peter Šurda 6add48e036
UPnP fix
- it looks like some UPnP server implementations consider NewRemoteHost
  to be a mandatory tag
7 years ago
Peter Šurda 0689525d61
UPnP fixes
- detects WANPPPConnection vs WANIPConnection
7 years ago
Peter Šurda 75eef9ef2f
Fix merge conflicts
Missed this difference in the last commit
8 years ago
Peter Šurda aabf600c38
Fix incorrectly resolved merge conflicts
Two file merge conflicts, __init__.py and upnp.py, were not resolved
correctly by the automatic resolving (probably because the affected code
was written by other people and I merged them into mailchuck fork). This
changes it to the same code that is in the mailchuck fork)
8 years ago
mailchuck 9edde110a2 Translation update
Some function calls were not being identified as text that should be
translated.
8 years ago
Peter Šurda 1b50f3898a UPnP fixes:
- external port iterator fix
- error handler fix
8 years ago
mailchuck a1b44aab44 UPnP fixes
- UPnP handles errors better
- it tries to bind external interface (previously sometimes it searched
on 127.0.0.1 resulting in no routers being detected)
8 years ago
mailchuck 4033b945ee UPnP status bar update fix 8 years ago
mailchuck 1b36da9327 Save UPnP port
Fixes #129
8 years ago
mailchuck f77afe8fae Exception handling 8 years ago
mailchuck 36ddbd365e Typo 8 years ago
mailchuck 410c23e8c0 Typo 8 years ago
mailchuck e82e33fa51 UPnP notifications
UPnP will notify you through window status bar.
8 years ago
mailchuck bbdfb1ea54 UPnP cleaner shutdown 8 years ago
mailchuck b00c4f24ec Threads close better
- UPnP and outgoingSynSender threads close slightly better.
- extPort initialisation was missing
8 years ago
mailchuck 48b9e50397 UPnP GUI
Settings GUI now contains a checkbox for UPnP and auto starts/stops the
thread when changed.
Default UPnP socket timeout decreased for faster thread
starting/stopping
8 years ago
mailchuck 50be5a2b4c UPnP fixes 8 years ago
mailchuck c03c563a74 Make UPnP into a thread
- UPnP is now a separate thread that will continue to setup UPnP
- shutdown waits for threads that shutdown correctly (Addresses
Bitmessage#549)
8 years ago
mailchuck cc848cdb65 Typo fix 8 years ago
mailchuck 5432c6e0c8 UPnP logging improvlement 8 years ago
Peter Šurda 0270dc3d4d Cleanup UPnP 8 years ago
lightrabbit f0f9f679e6 Add UPnP support. 8 years ago