Commit Graph

34 Commits

Author SHA1 Message Date
Christian Beer 65285574c1 Lib: tweak error messages
The snprintf() was moved one up because it can change errno before calling perror(). This way the correct error message is printed if getaddrinfo() fails and both functions (perror () and gai_strerror()) are thread-safe.
2016-05-02 11:20:00 +02:00
Christian Beer 9d05f5e6ad Lib: tweak error messages
As described in PR#1531 the original error message does not provide enough information. This also fixes that no unrelated error message is shown.
2016-05-02 09:09:57 +02:00
Rom Walton 90d23b72d8 lib: Cleanup low hanging fruit with regards to cleaning up sprintf.
Use snprintf instead.
2016-02-17 18:50:28 -05:00
Christian Beer 8219c10ad4 Lib: check return value of getsockopt()
fixes CID 27722 found by Coverity
2015-11-04 12:16:49 +01:00
Christian Beer 4effc53bde Lib: check return value of fcntl()
fixes CID 27704 found by Coverity
2015-11-04 12:02:43 +01:00
Christian Beer 4c659dd00f Lib: check return value of getsockname()
fixes CID 27697 found by Coverity
2015-11-04 11:52:11 +01:00
David Anderson db501739a6 client: timestamp all writes to stderr 2014-11-14 13:07:24 -08:00
David Anderson a79b5c7df7 client: fix Unix part of last checkin 2014-08-19 00:50:45 -07:00
David Anderson 861042c00f client: try to report an IP address other than loopback 2014-08-19 00:36:44 -07:00
David Anderson ab9b146054 vboxwrapper: add a general port-forwarding mechanism
All vbox_job.xml to specify ranges of port forwardings,
and whether the access to the host ports is remote or local.
This is to support MPI for Rytis.

Notes:
- the existing feature (pf_guest_port) is used only for web graphics.
  The host port is always dynamically assigned;
  there's no reason to have <pf_host_port>; I removed it from the doc.
  There's no reason to write the host port to a file; I removed that.
- The new feature is only for fixed host ports.
- The checkpoint file can stay the way it is.
2014-08-02 23:07:22 -07:00
David Anderson e22ffeb377 GUI RPC: add support for RPCs over Unix domain sockets (for Android)
- If run with --gui_rpc_unix_domain, the client will listen on
  a Unix-domain socket (named "boinc_socket") rather than on a TCP port.
- Add RPC_CLIENT::init_unix_domain() function to C++ GUI RPC interface
  (Note: we'll need to add a corresponding function to the Java interface)
- boinccmd: add --unix_domain option
2014-01-30 22:57:44 -08:00
David Anderson 5346ff3b7a BOINC lib: change get_mac_address to return just one address; prefer Ethernet 2013-11-18 10:20:46 -08:00
David Anderson 0983315cdb use MAXPATHLEN and sizeof() a few places; from Gianfranco 2013-05-22 13:56:48 -07:00
David Anderson fa8945fda9 - compile fix for FreeBSD 2013-03-04 15:04:51 +01:00
Oliver Bock a180e89fd8 Merge commit 'c15267a' into master
Conflicts:
	checkin_notes

Modified by author during merge:
	lib/network.cpp
2013-03-04 14:05:41 +01:00
David Anderson 53782b7de4 - lib: switch include order to the way it was (general to specific).
Should fix MinGW compile


svn path=/trunk/boinc/; revision=26008
2012-08-11 05:47:18 +00:00
David Anderson 22f93cf009 - Client: initial checkin for Android version. From Joachim Fritzsch.
svn path=/trunk/boinc/; revision=25982
2012-08-04 00:27:32 +00:00
David Anderson 405f567c81 - code cleanup: in foo.cpp, include foo.h first
svn path=/trunk/boinc/; revision=25933
2012-08-01 20:04:05 +00:00
David Anderson 8d8662adb2 - more code cleanup
svn path=/trunk/boinc/; revision=25838
2012-07-02 19:31:34 +00:00
David Anderson e279b59913 - Updates Linux notifications to use current libnotify.
- Fix build problems on Mac OS X using autotools
- Consistently use #if HAVE_X for platform checks,
    rather than #ifdef HAVE_X or #if defined(HAVE_X)
- In Unix build, make lots of compiler checks standard
- Fix some compile warnings

From Matt Arsenault.

Note: there are now lots of compile warnings in clientgui/ on Unix,
    mostly in WxWidgets code


svn path=/trunk/boinc/; revision=24303
2011-09-27 19:45:27 +00:00
David Anderson 65b942c799 - GUI RPC: when resolving hostnames, ask for only IPV4 addresses.
No point in allowing IPV6 since the client doesn't
    create a listening socket for IPV6

svn path=/trunk/boinc/; revision=22475
2010-10-07 18:08:20 +00:00
David Anderson 0d41de283a - client: revert to old network functions (gethostbyname() etc.) on Win:
- inet_ntop() etc. exist only on Vista+
		- the other functions are declared in winsock2.h.
			This breaks the Manager build, since wxwidgets includes winsock.h.
		So to hell with it.
	- windows build: manager doesn't depend on client

svn path=/trunk/boinc/; revision=22358
2010-09-15 20:33:44 +00:00
David Anderson 0f4735352a - client: a bit of IPv6 compatibility
- use "sockaddr_storage" to store network addresses
        (which may be IPv4 or IPv6)
        rather than assuming they fit in an int.
    - the entries in gui_rpc_auth.cfg may now be IPv6 addresses
        (a🅱️c:e:f:g format),
        or domain names of hosts that support only IPv6
    Note: GUI RPCs are still constrained to use IPv4,
    but this should be easy to change if it's every needed

    Also: replace deprecated gethostbyname() with getaddrinfo().

svn path=/trunk/boinc/; revision=22353
2010-09-15 17:41:25 +00:00
David Anderson 0f2440c90b - GUI RPC client side: set up a 30 second receive timeout for
socket to client.  That way GUI won't hang if client does.
    From Fred of BoincTasks

svn path=/trunk/boinc/; revision=21663
2010-05-31 21:51:09 +00:00
Rom Walton 9cb3e6ffc7 - client & lib: bring header inclusion up-to-date for the CC to begin
hunting down a memory leak.
        
    client/
        <Various Files>
    lib/
        <Various Files>

svn path=/trunk/boinc/; revision=21457
2010-05-11 19:10:29 +00:00
Rom Walton e14e1cad34 - Remove BOINC_RCSID tags from source files, we are doing branching and tagging
properly.
        
    <Various Files>

svn path=/trunk/boinc/; revision=20873
2010-03-12 16:51:57 +00:00
David Anderson 0b3ce504ff - Win: compile fixes
svn path=/trunk/boinc/; revision=18439
2009-06-16 21:58:38 +00:00
David Anderson d7aacaac32 - don't include config.h from network.h (Gabor Gombas)
svn path=/trunk/boinc/; revision=18428
2009-06-16 18:51:33 +00:00
David Anderson 12eb6057e5 - client, Mac: don't do res_init(). It causes a crash.
- client (Unix): if client crashes while benchmark processes are going,
    make sure they detect this and exit.
- back-end programs: remove hardwired assumptions about
    what directory they run in, and hence where config.xml is.
    E.g., daemons look for it in "..", others expect it in current dir.
    New approach: all the programs look for the project dir as follows:
    1) the environment var BOINC_PROJECT_DIR, if defined
    2) the current dir, if config.xml is there.
    3) else ".."
    This means you can run programs in either proj/bin/ or proj/,
    or (using BOINC_PROJECT_DIR) you can keep executables
    outside of the project dir.


svn path=/trunk/boinc/; revision=18042
2009-05-07 13:54:51 +00:00
David Anderson 72a59f0527 - client: put back the call to res_init() on lookup failure.
Apparently it worked after all.

svn path=/trunk/boinc/; revision=17793
2009-04-12 15:30:45 +00:00
David Anderson f3e362097e - client: back out res_init() change; it didn't work
svn path=/trunk/boinc/; revision=17758
2009-04-09 04:41:41 +00:00
David Anderson bc889ca27a - client: (unix): if host name lookup fails, call res_init().
This is an attempt to fix a problem on Linux where,
    if the client starts before a VPN is set up, it can never communicate

svn path=/trunk/boinc/; revision=17711
2009-03-31 16:45:17 +00:00
Eric J. Korpela 8f3abcc835 - Added checks for net/*.h, arpa/*.h, netinet/*.h and code to figure out
which of those files to include
    - Modified MAC address check to work on some non-Linux unixes.
      (mac_address.cpp)
    - Added suggested change to "already attached to project" checking.
      (ProjectInfoPage.cpp)
    - changed includes of standard c header files to their c++ equivalents
      (i.e. replaced <stdio.h> with <cstdio>) for namespace protection.
    - replaced "using namespace std;" with more explicit "using std::function" in
      several files.
    - Fixed bug in checking whether the os is OS/2 and added conditional OS_OS2
      to the build environment. (boinc_platform.m4,configure.ac)
    - Changed build environment to not use -nostandardlibs unless we are using
      G++ and static linkage is specified. (configure.ac)
    - Added makefiles and package building files for solaris CSW package manager.
    - Fixed bug with attempting to find login name using logname. (configure.ac)
    - Added ifdef HAVE_* protection around some include files commonly found in
      sys.
    - Added support for unified binary for x86_64/i686-pc-solaris.
      (cs_platforms.cpp)
    - generate_host_cpid() now uses MAC address on non-linux unix.
      (hostinfo_network.cpp)
    - Macro BOINC_SET_COMPILE_FLAGS now doesn't check gcc only flags on non-gcc
      compilers. (boinc_set_compile_flags.m4)
    - Library compiles no longer depend upon the library extension or require
      the library to be prefixed with lib.
    - More fixes for fcgi builds.
    - Added declaration of "struct ether_addr" and ether_ntoa().  Have not yet
      implemented ether_ntoa() for machines that don't have it, or where it is
      buggy.  (unix_util.h)
    - Added FCGI::perror() which calls FCGI_perror(). (boinc_fcgi.{h,cpp})
    - Fixed library Makefiles so that all required headers get installed.


svn path=/trunk/boinc/; revision=17388
2009-02-26 00:23:23 +00:00
David Anderson 98cfb8d3b0 - rename .C files to .cpp so that Doxygen will work
svn path=/trunk/boinc/; revision=16069
2008-09-26 18:20:24 +00:00