Commit Graph

371 Commits (21ae6cb9b00a17eb084ab994e5e6d4bed462f980)

Author SHA1 Message Date
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 7a4551e1e7
Fix signal handler in daemon mode
- signal handler requires the main thread to run
6 years ago
Peter Šurda 501f07dd34
Setsid is not available on Windows
- wrap an error handler around it
6 years ago
Peter Šurda 20cbac9752
Fix daemonize for Windows
Fixes #1034
6 years ago
Peter Šurda bdf61489ae
Allow multiple ReceiveQueue threads
- defaults to 3
6 years ago
Peter Šurda 4536e44b8c
Thread names propagate to system
- the thread names should now show up in the monitoring tools of
operating systems (tested on linux)
6 years ago
Peter Šurda fc19e4119a
Download thread updates
- now tracks downloads globally too, so it doesn't request the same
object from multiple peers at the same time
- retries at the earliest every minute
- stops trying to download an object after an hour
- minor fixes in retrying downloading invalid objects
6 years ago
Peter Šurda e00a02206b
AddrThread
- this thread is for spreading new/updated addresses in active
connections, analogous to the InvThread
- it doesn't do anything yet, this is just a dummy queue at the moment
6 years ago
Peter Šurda 2685fe29b1
Code quality improvements 6 years ago
Peter Šurda 618f3865c1
Main thread end
- instead of sleeping, it just ends
6 years ago
Peter Šurda 0cc8589b27
Asyncore updates
- should prevent the same object being re-requested indefinitely
- locking for object tracking
- move SSL-specific error handling to TLSDispatcher
- observe maximum connection limit when accepting a new connection
- stack depth test (for debugging purposes)
- separate download thread
- connection pool init moved to main thread
6 years ago
Peter Šurda a5c1b0c529
Asyncore fixes
- better handling of WSA* checks on non-windows systems
- handle EBADF on Windows/select
- better timeouts / loop lengths in main asyncore loop and
spawning new connections
- remove InvThread prints
6 years ago
Peter Šurda 02a07e5119
Asyncore update
- default to true (original attempt didn't work correctly)
6 years ago
Peter Šurda c85d52b8e8
Asyncore updates
- asyncore is now on by default
- inv announcements implemented
- bandwidth limit implemented / fixed
- stats on download / upload speed now work
- make prints into logger
- limit knownNodes to 20k as it was before
- green light fixed
- other minor fixes
6 years ago
Peter Šurda f8b4b427fc
Asyncore update
- bugfixes
- UDP socket for local peer discovery
- new function assembleAddr to unify creating address command
- open port checker functionality (inactive)
- sendBigInv is done in a thread separate from the network IO
thread
6 years ago
Peter Šurda d699a28e49
Add variables to errno and socket
- to make sure they work cross platform without having to do
complicated tests
6 years ago
Peter Šurda e309a1edb3
Asyncore update
- separate queue for processing blocking stuff on reception
- rewrote write buffer as a queue
- some addr handling
- number of half open connections correct
6 years ago
Peter Šurda 51e52401fe
Windows plaform check pythonic
- moved to .startswith instead of 'in'
- thanks @Lvl4sword
6 years ago
Peter Šurda d635e515b9
Big Asyncore update
- most of the stuff is done so it partially works
- disabled pollers other than select (debugging necessary)
- can switch in the settings, section network, option asyncore (defaults
to False)
6 years ago
Dmitri Bogomolov 34084bbc80
Total setup.py cleanup and simple script installation 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 e664746f04
More knownNodes init
- also init children if they are missing
7 years ago
Peter Šurda 35a712d11d
KnownNodes missing init
- init knownnodes when connecting to a stream
7 years ago
Peter Šurda 157881bc63
Cyclic import fix
- networkDefaultProofOfWorkNonceTrialsPerByte and
  networkDefaultPayloadLengthExtraBytes cyclic import fix
- PyBitmessage should launch now when there's no keys.dat
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 f6bdad18a3
Improved stream handling
- version command sends list of all participating streams
- biginv sends lists of hosts for all streams the peer wants (plus
  immediate children)
- objects will spread to all peers that advertise the associated stream
- please note these are just network subsystem adjustments, streams
  aren't actually usable yet
7 years ago
Peter Šurda 4f70eaa01f
Fix curses mode 7 years ago
Peter Šurda fa0a3135e7
Fixes pointed out by landscape.io
- missing/wrong/obsolete imports
- logger formatting
7 years ago
Peter Šurda ac348e4e6b
Fixes and refactoring
- fixes errors introduced in the earlier refactoring
- more variables moved to state.py
- path finding functions moved to paths.py
- remembers IPv6 network unreachable (in the future can be used to skip
  IPv6 for a while)
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 e84b19613e
Inventory refactoring
- minor refactoring, made it into singleton instead of a shared global
  variable. This makes it a little bit cleaner and moves the class into
a separate file
- removed duplicate inventory locking
- renamed singleton.py to singleinstance.py (this is the code that
  ensures only one instance of PyBitmessage runs at the same time)
7 years ago
Peter Šurda 60c447f56b
Merge commit 'd3a0404274e5105b9d6279901246af8f7009eb6d' into v0.6
- "env python2.7.x" was causing problems
7 years ago
Peter Šurda 36a04fd7d9
Add SMTP server
- you can now use SMTP to send messages
- uses bmaddr.lan domain
- runs on 127.0.0.8425 if you set "smtpd" to True
- mandatory authentication with smtpdusername and smtpdpassword
7 years ago
ng0 d3a0404274 Fix python shebangs from `#!/usr/bin/env python2.7*' to `#!/usr/bin/python2.7'.
* src/bitmessagecli.py: fix it.
* src/bitmessagemain.py: same.

This fixes #887.
7 years ago
Peter Šurda 685ff6cecd
Startup fixes
- correctly test for "smtpdeliver" variable without crashing
- new method for safely getting values from config even if the option
  may be missing
7 years ago
Peter Šurda d3e8771aed
Lock file fixes
- daemon mode lock file didn't work correctly in the last commit
7 years ago
Peter Šurda 4865659d72
Main process fixes
- handles old dialog versions better if using curses
- can spawn SMTP delivery thread if configured (only when in daemon
  mode)
- daemonized mode now works more like it's properly supposed to on unix
  (double fork etc). You may have to adjust your init scripts, when
  when using upstart for example you should now use "expect daemon"
- daemon mode now cleanly shuts down when TERM/INT signal is received
7 years ago
mailchuck b724d3ee4f Copyright year updates 7 years ago
mirrorwish 554627dd92 Refactor Inventory 7 years ago
mailchuck 0ab0e6757a Restrict pending parallel requests on proxy
This saves some network resources if using Tor, for example.
7 years ago
mailchuck bcae62938a Unused variable 7 years ago
mailchuck 24a2deed8f Cleanup lockfile on exit
singleton.py design was broken.
Fixed Bitmessage#775
7 years ago
mailchuck 6a965cd31a Don't test for Qt in daemon mode
Initialisation of the daemon variable was missing at launch.

Fixes #161
7 years ago
mailchuck 549d91dc68 Re-disable windows SMP frozen support
The recommended workaround didn't work.
7 years ago
mailchuck d0b73eb211 SMP fix for frozen Windows 7 years ago
mailchuck d69c2e097f Cleaner shutdown
Addresses Bitmessage#549
7 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)
7 years ago
Denilson M. Amorim 28f46cb8b3 Dont run twice if daemon too 7 years ago
Denilson M. Amorim cf610080b9 Squash: Single instance and pop up old instance 7 years ago
lightrabbit f0f9f679e6 Add UPnP support. 7 years ago
sbkaf 800fd2a143 finished implementing more email client like interface 7 years ago
sbkaf 585873e4f3 interface 7 years ago
Jonathan Warren ba27f6e8a6 Made error message for Raspberry Pi users less serious-sounding 9 years ago
bmng-dev 23b55652b9 New depends module to check dependencies. Moved version check to new depends module. 9 years ago
Jonathan Warren fdb0d1e776 Merge branch 'master' into ProtoV3 9 years ago
Jonathan Warren 61653bdc0d Revert "Catch the standard Unix SIGTERM kill signal and do a graceful shutdown" 9 years ago
Jonathan Warren e096c37f7e save debug.log in correct directory 9 years ago
Jonathan Warren b6e0396333 resolve minor merge conflict with master 9 years ago
Jonathan Warren c306062282 Bitmessage Protocol Version Three 9 years ago
JonathanCoe 3b42805efc Catch the standard Unix SIGTERM kill signal and do a graceful shutdown of PyBitmessage.
We already do this for the SIGINT kill signal. The change allows us to do a clean
shutdown of PyBitmessage when its process has been separated from the terminal.
9 years ago
Jonathan Warren ea6f34ade6 removed use of memoryview so that we can support python 2.7.3 9 years ago
bmng-dev 4430ed0cb5 Improve version check
Move version check so it is the very first thing we do.
Perform version check for all platforms
Ensure backwards and forwards compatibility
9 years ago
Ruben de Vries c8bf3ccc63 moved the check for PyQt so that we don't need to install it when running -c 9 years ago
Jonathan Warren a2a7edc9be resolve merge conflict 9 years ago
Luke Montalvo 01003fc56c Merge branch 'master' of https://github.com/Bitmessage/PyBitmessage 10 years ago
Luke Montalvo 813f4c7ed9 + Add dependency list
+ Add stderr capturing
+ Add identities and network status tabs
+ Add dialogs to configure identities
+ Add color pair definitions
+ Add the '-c' flag to use the curses interface
* Reorganize imports
* Switch logger to file_only mode when running with curses
10 years ago
Neil Roberts 7da6ea958f Add support for IPv6
It will now listen on an IPv6 socket if possible or fall back to IPv4
if that doesn't work. It will no longer filter out all IPv6 addresses
and instead it will only filter out those that point to the local
network.

It looks like the DNS bootstrapping should just automatically work
because getaddrinfo already returns IPv6 addresses from the AAAA
record.

In order to convert from the ASCII representation of IPv6 addresses
and back we need inet_ntop and inet_pton. Python 2 doesn't currently
provide these for Windows so instead this patch provides a hot patch
to the socket module which wraps WSAStringToAddress and
WSAAddressToString using ctypes.
10 years ago
Jonathan Warren c98ca590a8 Fix #566 10 years ago
Jonathan Warren 0b81e9b206 rename bitmessageapi.py to api.py 10 years ago
Jonathan Warren 6af92a5e09 fix line which keeps user from running more than once Bitmessage instance 10 years ago
Jonathan Warren d150476e98 Added comments and console output to expain that you cannot run bitmessageapi.py directly 10 years ago
Eino Mäkitalo baf634f89b Merge with original upstream changes
Conflicts:
	src/bitmessagemain.py
10 years ago
Eino Mäkitalo b0c582605f Cleaning imports and separating API to another file. PyLint fixes for main file 10 years ago
Jonathan Warren 08b92541c6 Merge pull request #588 from BioGeek/patch-1
remove duplicate code
10 years ago
Jonathan Warren 12adccf965 Merge pull request #576 from yurivict/tray_inbox_unread_indicator
[NEW FEATURE] Implemented the indicator in tray icon that there are unread messages
10 years ago
Jeroen Van Goey 90b0d4c640 remove duplicate code
There was twice a check for the Python version on OSX, but the logging in the second check was never reached
10 years ago
Jeroen Van Goey fb98cd0fc8 remove duplicate code
There was twice a check for the Python version on OSX but the logging in the second step could never be reached.
10 years ago
Jonathan Warren df7116bd72 on close, save objectProcessorQueue to disk 10 years ago
Yuri 42faf2aaa0 [NEW FEATURE] Implemented the indicator in tray icon that there are unread messages. 10 years ago
Jonathan Warren 45a0046e7d completed work on objectProcessorThread 10 years ago
Jonathan Warren a4b5ded803 we no longer need to add chans to our address book 10 years ago
Jonathan Warren 6abb589f01 Merge branch 'master' of github.com:Atheros1/PyBitmessage 10 years ago
Jonathan Warren 41c3b73343 comment 10 years ago
Jonathan Warren 9dd674a117 Merge pull request #535 from Atheros1/master
API commands: createChan, joinChan, leaveChan, deleteAddress
10 years ago
Jonathan Warren 12edee4ac4 added API commands: createChan, joinChan, leaveChan, deleteAddress 10 years ago
Jonathan Warren 19eb77fb4f Merge branch 'master' of git://github.com/Eylrid/PyBitmessage into Eylrid-master 10 years ago
Joshua Noble ed0a57d998 Fixed typo in getInboxMessagesByAddress 10 years ago
John Kozan 6787e4b932 == should be = 10 years ago
fuzzgun b37e0ec027 Changelog update for 0.4.0 10 years ago
amos 379d27b5d8 update address versions in addChan 10 years ago
amos 000fe293d6 Merge branch 'decodeAddress2'
Conflicts:
	src/bitmessagemain.py
10 years ago
amos e878fb4c96 Add api method decodeAddress
Add decodeAddress as an api call. Like the addresses.decodeAddress function
it return status, addressVersion, streamNumber, and ripe. ripe is base64
encoded.
10 years ago
Jonathan Warren 7e07d7bc7e _verifyAddress support v4 addresses 10 years ago
amos 8a3028e7c1 Merge branch 'fixApi' 10 years ago
amos cdf4d5d75c Change the accepted address versions
Update _verifyAddress to accept version 4.
10 years ago
amos 250f36b670 Merge branch 'master' of https://github.com/Bitmessage/PyBitmessage 10 years ago
Jonathan Warren ef500501d7 small fixes to address generator and listAddresses2 10 years ago
Jonathan Warren 02ea2a50d3 more v4 address work. Should be done. 10 years ago
Jonathan Warren 56168e82b5 most initial work on v4 pubkeys completed 10 years ago
Amos Bairn 40033d9e87 add api method addChan
This solves issue #484
10 years ago