Commit Graph

40 Commits

Author SHA1 Message Date
Rom Walton 2cc9a0b6c4 client: Cleanup low hanging fruit with regards to cleaning up sprintf.
Use snprintf instead.
2016-02-18 00:59:13 -05:00
Rom Walton 20a4275937 client: Cleanup low hanging fruit with regards to cleaning up strcpy and strcat use.
Use safe_strcpy and safe_strcat when dealing with non-pointer data types.
2016-02-16 00:14:52 -05:00
David Anderson 37a93fb8e8 client: don't count user or project files in transfer limit
We don't want stalled downloads of project image files
to block the downloading of job input files.
2015-12-29 15:06:11 -08:00
David Anderson 37b64313fe client, Win: load SetPriorityClass() dynamically so we don't fail on XP
Also message tweak
2015-09-29 13:37:27 -07:00
Julien Nabet d75222ebf3 cppcheck: Prefer prefix ++/-- operators for non-primitive types 2015-01-14 21:18:29 +01:00
David Anderson 1e2fcb4b68 client/lib: change CONFIG to CC_CONFIG, config to cc_config.
Eliminates ambiguity of "config" global var, which is used in server code.
This confuses IDEs that are looking at all the code at once.
2014-05-08 00:51:18 -07:00
David Anderson 24e8133e4b - tabs -> spaces 2013-04-02 17:23:37 -07:00
David Anderson 825dc2e606 - client: if <dont_check_file_sizes> is set in config, still check for
errors (e.g. verify failures) at startup, and reset file if so.
   Otherwise we'll never recover from those errors.
2013-03-22 10:43:05 +01:00
David Anderson 9481e04e7b - client: there were many places in the code where we keep track
(usually in a static variable called "last_time")
    of the last time we did something,
    and we only do it again when now - last_time exceeds some interval.
    Example: sending heartbeat messages to apps.
    Problem: if the system clock is decreased by X,
    we won't do any of these actions are time X,
    making it appear that the client is frozen.
    Solution: when we detect that the system clock has decreased,
    set a global var "clock_change" for 1 iteration of the polling loop,
    and disable these time checks if clock_change is set.
2013-03-22 10:28:20 +01:00
David Anderson eea35c152e - client: when checking file sizes at startup,
skip image files if the "dont_verify_images" pref is set.
    Otherwise we'll downloading the file on each startup.
    From Juha.
2013-03-04 17:39:23 +01:00
David Anderson ce47010dbb - client: if <dont_check_file_sizes> is set, don't check file existence at startup
- wrapper: open files in shared mode so you can look at them while wrapper is running
2013-03-04 15:23:37 +01:00
David Anderson b412b9d172 - client: fix bug that broke file signing with X.509 certificates.
From matszpk.  Fixes #1168.


svn path=/trunk/boinc/; revision=26071
2012-09-02 20:05:20 +00:00
David Anderson f8c1665722 - client: keep track of the fraction of time that
1) a network connection is available and
    2) network communication is allowed and
    3) CPU computation is allowed
- If an app version is marked as needs_network,
    use the above fraction in estimating its rate of progress
- replace "core client" with "client" in comments.
- scheduler: message tweaks


svn path=/trunk/boinc/; revision=25803
2012-06-26 20:30:56 +00:00
David Anderson 32a08d27d9 - C++ code: use MAXPATHLEN for char arrays that hold paths
svn path=/trunk/boinc/; revision=25659
2012-05-09 16:11:50 +00:00
David Anderson bbfbef0fe8 - client: code cleanup. Move RESULT and PROJECT to separate files
svn path=/trunk/boinc/; revision=25621
2012-04-30 21:00:28 +00:00
David Anderson e59816234e - client: only check file size if the FILE_INFO specifies it.
svn path=/trunk/boinc/; revision=25225
2012-02-09 09:15:23 +00:00
David Anderson 4c545f407a if file is wrong size on startup, delete it
svn path=/trunk/boinc/; revision=25224
2012-02-09 01:06:15 +00:00
David Anderson d2cf999563 - client: on startup, check file size as well as existence
- client: add <async_file_debug> log flag
- client: do decompress (both sync and async) to a temp file,
    then rename
- client: if a file's status is VERIFY_PENDING on startup,
    set it to NOT_PRESENT; that will trigger a verify
- client: do async copy only if size is above threshold


svn path=/trunk/boinc/; revision=25222
2012-02-09 00:47:04 +00:00
David Anderson bfe3b7cbb8 - client: fix bug in async file verify.
File verify is done in 4 places:
    - after a download finishes
    - transition result to DOWNLOADED
    - if project->verify_files_on_app_start, on app start
    Use asynchrony only in the first 2 cases,
    since the async logic is set up to mark the file as PRESENT
    when done, not to restart a task


svn path=/trunk/boinc/; revision=25219
2012-02-08 19:30:57 +00:00
David Anderson d6534ba118 - client: async file stuff
svn path=/trunk/boinc/; revision=25210
2012-02-06 23:33:23 +00:00
David Anderson ea2e64cef5 - client: async file stuff
svn path=/trunk/boinc/; revision=25209
2012-02-06 22:57:36 +00:00
David Anderson 21d0a20b08 - client: tweaks to AMD GPU detection msgs
- client: async file stuff

svn path=/trunk/boinc/; revision=25208
2012-02-06 21:13:04 +00:00
David Anderson 223be7e62d - async verify
svn path=/trunk/boinc/; revision=25207
2012-02-06 20:41:26 +00:00
David Anderson cdd40fcc10 - client: intermediate checkin for async file verification
svn path=/trunk/boinc/; revision=25202
2012-02-06 06:06:44 +00:00
David Anderson 63804486c0 - client: after a gzipped file is downloaded,
we uncompress it and then verify it.
    The latter involves computing its MD5, which reads the entire file.
    Combine these 2 steps so that the MD5 is computed
    as the file is uncompressed,
    eliminating the need to read the file again.


svn path=/trunk/boinc/; revision=25157
2012-01-26 23:13:00 +00:00
David Anderson 36c6c529a2 - client: bug fixes in gzipped download code
svn path=/trunk/boinc/; revision=25141
2012-01-24 20:41:22 +00:00
David Anderson 44f173605e - client: add a mechanism for restartable download of compressed files.
(It turns out that the compression schemes supported by
        Apache and libcurl, suprisingly, aren't restartable.)

        if a <file_info> from the server contains <gzipped_url> tags,
        use those instead of the <url> tags,
        and flag the file as "download_gzipped".
        If this is the case, download NAME.gz and save it as NAME.gzt.
        When the download is complete, rename NAME.gzt to NAME.gz,
        and uncompress it to NAME.
        (this ensures that if NAME.gz is present, it's complete).
        Also do the uncompression, if needed, in verify_file().
        This ensures that the uncompression will eventually get done
        even if the client quits are crashes in the middle.

    - update_versions: if <gzip> is present in a <file_info>,
        add a gzipped copy in the download directory
        and add a <gzipped_url> elements to the app version's xml_doc.


svn path=/trunk/boinc/; revision=25112
2012-01-20 23:34:15 +00:00
David Anderson c317f4b721 - client: attempt to fix bug reported by John McLeod,
where the client crashes after giving up (90 day timeout) on an upload.
    I'm guessing this was caused by [24391],
    which changed the order in the poll loop from
        garbage_collect
        file_xfers->poll
        pers_file_xfers->poll
        handle_pers_file_xfers
    to
        garbage_collect
        handle_pers_file_xfers
        file_xfers->poll
        pers_file_xfers->poll
    I don't understand why this would have caused a crash,
    but so be it.
    I restored the original order, but with handle_pers_file_xfers
    not inside the if (!network_suspended).
- client renamed handle_pers_file_xfers() to
    create_and_delete_pers_file_xfers()
- client simulator: show simulator CPU time


svn path=/trunk/boinc/; revision=24531
2011-11-04 20:25:30 +00:00
David Anderson 921b5c50df - client: create and destroy PERS_FILE_XFERs even if network suspended.
This will show pending uploads in the Transfers tab.
- file_upload_handler: fix message to client when can't acquire lock
- client: parse <alt_platform> in state file correctly


svn path=/trunk/boinc/; revision=24391
2011-10-13 19:05:18 +00:00
David Anderson 8296968cbb - client: changes to the client file model to support distributed storage,
as described here: http://boinc.berkeley.edu/trac/wiki/ClientDataModel
        Compatibility:
            clients that upgrade to this version should see nothing unusual.
            Clients that downgrade from this version to a previous version
            should see all projects reset
            (i.e. tasks disappear and then get re-downloaded).
    - manager: always show whether a file transfer is upload or download
    - client: don't scale work requests by resource share

svn path=/trunk/boinc/; revision=23862
2011-07-20 19:12:10 +00:00
David Anderson 7075ce8285 - client: add <http_transfer_timeout_bps> config option.
Defines the transfer rate below which the connection
    is considered idle, and timeout starts


svn path=/trunk/boinc/; revision=23514
2011-05-07 17:56:13 +00:00
David Anderson 6784283211 - user web: fix bugs in server status page
- fix some indentation


svn path=/trunk/boinc/; revision=22890
2011-01-06 23:09:13 +00:00
David Anderson fcbb8a286e - client simulator: major remodel and upgrade.
Insteady of using its own XML input files,
    the simulator now takes a client_state.xml file as input.
    The simulator generates a synthetic workload based on the
    projects, apps, app versions, WUs, and result it finds there.

    This means that a user seeing aberrant behavior
    can just send their client_state.xml file
    and (hopefully) we can use the simulator to repro.

    The simulator now can model GPUs.

    As of this checkin, the simulator compiles but doesn't work.
    There should be no change in the actual client.


svn path=/trunk/boinc/; revision=22409
2010-09-24 20:02:42 +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
David Anderson 26c0814d26 - client: clean up network suspension logic.
There are now separate flags for
    "file_xfers_suspended": don't do file transfers
    "network_suspended": don't do any network comm
        (scheduler RPCs, RSS fetch, master fetch, etc.)
    The policy:
    if preferences/settings say no network
    (quota exceeded, no-network mode, user active, time, excl. app)
    then:
        file_xfers_suspended = true
        if (no recent network-related RPC) network_suspended = true
- user web: code cleanup for project prefs

svn path=/trunk/boinc/; revision=21299
2010-04-26 19:31:28 +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 7e69f86942 - client: don't print error msg if file is wrong size on startup
svn path=/trunk/boinc/; revision=19103
2009-09-18 20:49:54 +00:00
David Anderson 31e7127776 - client: make timeout values into #defines
svn path=/trunk/boinc/; revision=17396
2009-02-26 03:24:39 +00:00
David Anderson 26f4f33b22 - client: print message if downloaded file has wrong size
- client: associate file xfer messages with a project; fixes #848

svn path=/trunk/boinc/; revision=17334
2009-02-22 20:54:33 +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