aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Split up util.cpp/hWladimir J. van der Laan2014-08-261-0/+2
| | | | | | | | | | | | | | | | Split up util.cpp/h into: - string utilities (hex, base32, base64): no internal dependencies, no dependency on boost (apart from foreach) - money utilities (parsesmoney, formatmoney) - time utilities (gettime*, sleep, format date): - and the rest (logging, argument parsing, config file parsing) The latter is basically the environment and OS handling, and is stripped of all utility functions, so we may want to rename it to something else than util.cpp/h for clarity (Matt suggested osinterface). Breaks dependency of sha256.cpp on all the things pulled in by util.
* Remove all other print() methodsWladimir J. van der Laan2014-08-201-10/+0
| | | | All unused.
* Merge pull request #4605Wladimir J. van der Laan2014-08-181-1/+11
|\ | | | | | | | | | | | | aa82795 Add detailed network info to getnetworkinfo RPC (Wladimir J. van der Laan) 075cf49 Add GetNetworkName function (Wladimir J. van der Laan) c91a947 Add IsReachable(net) function (Wladimir J. van der Laan) 60dc8e4 Allow -onlynet=onion to be used (Wladimir J. van der Laan)
| * Add GetNetworkName functionWladimir J. van der Laan2014-07-301-0/+10
| | | | | | | | Returns the network name for an Network enum.
| * Allow -onlynet=onion to be usedWladimir J. van der Laan2014-07-301-1/+1
| | | | | | | | | | Just an alias for onlynet=tor, but matches the new name of the proxy option -onion= better.
* | small net cleanupPhilip Kaufmann2014-08-081-0/+1
|/ | | | | | - add comment for disabling sigpipe - add closing comment in compat.h - remove redundant check in net.h
* net: add SetSocketNonBlocking() as OS independent wrapperPhilip Kaufmann2014-07-171-29/+41
|
* Convert closesocket 'compat wrapper' to function in netbaseWladimir J. van der Laan2014-07-171-20/+33
| | | | | | | | | | | Simpler alternative to #4348. The current setup with closesocket() is strange. It poses as a compatibility wrapper but adds functionality. Rename it and make it a documented utility function in netbase. Code movement only, zero effect on the functionality.
* Merge pull request #4479Wladimir J. van der Laan2014-07-081-1/+2
|\ | | | | | | 109849e Bugfix: strerror_r can return an error, and if it does, POSIX does not specify the content of the buffer (Luke Dashjr)
| * Bugfix: strerror_r can return an error, and if it does, POSIX does not ↵Luke Dashjr2014-07-071-1/+2
| | | | | | | | specify the content of the buffer
* | Fix the build for windowsWladimir J. van der Laan2014-07-071-4/+3
| | | | | | | | Problem introduced in caf6150. Thanks to @drak for noticing. Fixes #4473.
* | remove SOCKS4 support from core and GUIPhilip Kaufmann2014-07-071-93/+27
| | | | | | | | - now we support SOCKS5 only
* | Use async name resolving to improve net thread responsivenessHuang Le2014-06-271-1/+59
| | | | | | | | | | | | | | | | | | | | | | | | In the LookupIntern(), things changed are: 1. Call getaddrinfo_a() instead of getaddrinfo() if available, the former is a sync version of the latter; 2. Try using inet_pton()/inet_addr() to convert the input text to a network addr structure at first, if success the extra name resolving thread inside getaddrinfo_a() could be avoided; 3. An interruption point added in the waiting loop for return from getaddrinfo_a(), which completes the improve for thread responsiveness. A easy way to see the effect is to kick off a 'bitcoind stop' immediately after 'bitcoind -daemon', before the change it would take several, or even tens of, minutes on a bad network situation to wait for the running bitcoind to exit, now it costs only seconds. Signed-off-by: Huang Le <[email protected]>
* | replace 3 separate calls to WSAGetLastError() with 1Philip Kaufmann2014-06-241-1/+2
| |
* | Merge pull request #4183Wladimir J. van der Laan2014-05-251-5/+0
|\ \ | |/ |/| | | | | | | | | | | | | f40dbee remove CPubKey::VerifyCompact( ) which is never used (Kamil Domanski) 28b6c1d remove GetMedianTime( ) which is never used (Kamil Domanski) 5bd4adc remove LookupHostNumeric( ) which is never used (Kamil Domanski) 595f691 remove LogException( ) which is never used (Kamil Domanski) f4057cb remove CTransaction::IsNewerThan which is never used (Kamil Domanski) 0e31e56 remove CWallet::AddReserveKey which is never used (Kamil Domanski)
| * remove LookupHostNumeric( ) which is never usedKamil Domanski2014-05-201-5/+0
| |
* | Replace non-threadsafe strerrorWladimir J. van der Laan2014-05-231-4/+37
|/ | | | | | | Log the name of the error as well as the error code if a network problem happens. This makes network troubleshooting more convenient. Use thread-safe strerror_r and the WIN32 equivalent FormatMessage.
* net: Add CSubNet class for subnet matchingWladimir J. van der Laan2014-05-091-3/+120
|
* Use new function parseint32 in SplitHostPortWladimir J. van der Laan2014-05-091-5/+3
| | | | | Use the new function parseint32 in SplitHostPort instead of calling strtol directly.
* Remove build-time no-IPv6 settingWladimir J. van der Laan2014-05-011-26/+0
| | | | | | | | | | | The year is 2014. All supported operating systems have IPv6 support, most certainly at build time (this doesn't mean that IPv6 is configured, of course). If noone is exercising the functionality to disable it, that means it doesn't get tested, and IMO it's better to get rid of it. (it's also not used consistently in RPC/boost and Net code...)
* Correct some proxy related socket leaks.Gregory Maxwell2014-04-091-2/+7
|
* Copyright header updates s/2013/2014 on files whose last git commit was done ↵gubatron2014-02-091-1/+1
| | | | | | in 2014. contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
* Remove redundant .c_str()sWladimir J. van der Laan2014-01-231-12/+12
| | | | | | | After the tinyformat switch sprintf() family functions support passing actual std::string objects. Remove unnecessary c_str calls (236 of them) in logging and formatting.
* core: remove includes in .cpp, if header is already in .hPhilip Kaufmann2013-11-151-2/+0
| | | | | - example: if util.h includes stdint.h, remove it from util.cpp, as util.h is the first header included in util.cpp
* Improve logging of failed connectionsGavin Andresen2013-11-111-5/+5
|
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-5/+9
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Bump Year Number to 2013super32013-10-201-1/+1
|
* Hurricane Electric uses block 2001:470::, not 2011:470::David Hill2013-10-041-1/+1
|
* Replace printf with LogPrintf / LogPrintGavin Andresen2013-09-181-13/+13
|
* autotools: switch to autotools buildsystemCory Fields2013-09-051-0/+4
|
* Fix fcntl include in net.cpp & netbase.cppfcicq2013-07-171-1/+1
|
* fix !O_NONBLOCK where ~O_NONBLOCK was meantWladimir J. van der Laan2013-04-271-17/+10
| | | | | | Using ! on a non-zero value will always return 0. Also remove some duplicate and superfluous code in other places.
* Split off hash.h from util.hPieter Wuille2012-12-181-0/+1
|
* don't use memset() in privacy/security relevant code partsPhilip Kaufmann2012-11-091-1/+1
| | | | | | | | | | | | As memset() can be optimized out by a compiler it should not be used in privacy/security relevant code parts. OpenSSL provides the safe OPENSSL_cleanse() function in crypto.h, which perfectly does the job of clean and overwrite data. For details see: http://www.viva64.com/en/b/0178/ - change memset() to OPENSSL_cleanse() where appropriate - change a hard-coded number from netbase.cpp into a sizeof()
* Merge pull request #1913 from sipa/noi2pWladimir J. van der Laan2012-10-111-37/+4
|\ | | | | Remove I2P support from netbase
| * Remove I2P support from netbasePieter Wuille2012-10-071-37/+4
| | | | | | | | | | | | | | | | | | | | | | I2P apparently needs 256 bits to store a fully routable address. Garlicat requires a centralized lookup service to map the 80-bit addresses to fully routable ones (as far as I understood), so that's not really usable in our situation. To support I2P routing and peer exchange for it, another solution is needed. This will most likely imply a network protocol change, and extension of the 'addr' message.
* | Merge pull request #1901 from laanwj/2012_10_remove_strlcpyWladimir J. van der Laan2012-10-111-9/+7
|\ \ | | | | | | get rid of strlcpy.h
| * | get rid of strlcpy.hWladimir J. van der Laan2012-10-071-9/+7
| |/ | | | | | | | | Don't use hand-rolled string manipulation routine with a fixed buffer in the bitcoin core, instead make use of c++ strings and boost.
* / add LOCK() for proxy related data-structuresPhilip Kaufmann2012-10-041-12/+29
|/ | | | | | | | | - fix #1560 by properly locking proxy related data-structures - update GetProxy() and introduce GetNameProxy() to be able to use a thread-safe local copy from proxyInfo and nameproxyInfo - update usage of GetProxy() all over the source to match the new behaviour, as it now fills a full proxyType object - rename GetNameProxy() into HaveNameProxy() to be more clear
* Merge pull request #1793 from Diapolo/fix_signed_unsigned_strprintfWladimir J. van der Laan2012-09-211-2/+2
|\ | | | | fix signed/unsigned in strprintf and CNetAddr::GetByte()
| * fix signed/unsigned in strprintf and CNetAddr::GetByte()Philip Kaufmann2012-09-121-2/+2
| | | | | | | | | | | | - I checked every occurance of strprintf() in the code and used %u, where unsigned vars are used - the change to GetByte() was made, as ip is an unsigned char
* | Trim trailing whitespace for src/*.{h,cpp}Jeff Garzik2012-09-181-4/+4
|/
* Bugfix: Fix a variety of misspellingsLuke Dashjr2012-08-011-4/+4
|
* Fix OBO in socks5 auth proposal. This fixes compatibility with openssh's ↵Douglas Huff2012-07-071-1/+1
| | | | socks5 proxy and tor's .2.3.x branch.
* Rewrite CNetAddr::GetReachabilityFrom()Pieter Wuille2012-06-231-30/+73
| | | | Add support for Tor/I2P networks, and make code more readable.
* Node support for Tor hidden servicesPieter Wuille2012-06-231-15/+76
| | | | | | This commit adds support for .onion addresses (mapped into the IPv6 by using OnionCat's range and encoding), and the ability to connect to them via a SOCKS5 proxy.
* Fix netbase testsPieter Wuille2012-06-191-4/+2
| | | | | * Do not rely on "a.b.c" being interpreted as "a.0.b.c" * Parse numeric addresses for address families for which no device is configured
* Merge pull request #1399 from sipa/ipparseGavin Andresen2012-06-181-43/+26
|\ | | | | Improve parsing of IPv6 addresses
| * Improve parsing of IPv6 addressesPieter Wuille2012-06-141-43/+26
| | | | | | | | | | | | | | Implement the following rules: * Interpret [X]:Y as host=X port=Y, if Y is an integer * Interpret X:Y as host=X port=Y, if Y is an integer and X contains no colon * Interpret X:Y as host=X:Y port=default otherwise
* | Merge branch 'signbugs' of https://github.com/wizeman/bitcoinGavin Andresen2012-06-181-2/+2
|\ \ | |/ |/| | | Resolved minor conflict in main.cpp