Commit Graph

45 Commits

Author SHA1 Message Date
Julien Nabet d75222ebf3 cppcheck: Prefer prefix ++/-- operators for non-primitive types 2015-01-14 21:18:29 +01:00
David Anderson 5f7366e19b client: work with old versions of libcurl
With old (7.15) versions of libcurl, args passed to curl_easy_setopt()
(such as the URL) were supposed to remain unchanged until
the operation was done.
Starting with 7.17 it was changed so that curl_easy_setopt()
copied its arguments.
The BOINC client was assuming the latter.
When linked against the former,
URLs would mysteriously change to garbage strings.

I changed things to work with the old libcurl semantics.
2014-03-14 00:21:15 -07:00
David Anderson 7455e6b5b7 Client (Android): if no keepalive from GUI, exit rather than suspend
Also: message tweaks
2014-02-17 15:40:58 -08:00
David Anderson eee2879a57 client: fix bug that allowed work fetch request while file uploads active
A while back we added a mechanism intended to defer work-request RPCs
while file uploads are happening,
with the goal of reporting completed tasks sooner
and reducing the number of RPCs.
There were 2 bugs in this mechanism.
First, the decision of whether an upload is active was flawed;
if several uploads were active and 1 finished,
it would act like all had finished.
Second, when WORK_FETCH::choose_project.cpp() picks a project,
it sets p->sched_rpc_pending to RPC_REASON_NEED_WORK.
If we then decide not to request work because an upload
is active, we need to clear this field.
Otherwise scheduler_rpc_poll() will do an RPC to it,
piggybacking a work request and bypassing the upload check.
2013-06-14 22:40:43 -07: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 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 6498b0bba2 - client: set PROJECT::last_upload_start whenever an upload starts,
not just when a result becomes ready to upload.
    Fix bug where a scheduler RPC to report results is done
    even though uploads are active.
- client: cpu_sched_debug enables messages about not scheduling jobs
    because of insufficient RAM
    

svn path=/trunk/boinc/; revision=25493
2012-03-26 22:01:31 +00:00
David Anderson 21d4a3d9c2 - client: zero PROJECT::last_upload_start on reset,
so that we can fetch work immediately
	- client: in PERS_FILE_XFER::create_xfer(),
		check for already-existing file before seeing we're allowed to start a new xfer
	- client: in PERS_FILE_XFER::create_xfer(),
		if an async verify is in progress, mark PERS_FILE_XFER as done.

svn path=/trunk/boinc/; revision=25243
2012-02-13 05:02:51 +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 739f40c4f7 - client: HTTP range request errors are permanent.
svn path=/trunk/boinc/; revision=25213
2012-02-07 07:58:08 +00:00
Charlie Fenton 659fb8ceb0 client: Fix compiler warning generated by above checkin
svn path=/trunk/boinc/; revision=25204
2012-02-06 08:24:21 +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 83f91025e7 - client: if we're trying to upload a file and it's missing,
that's a permanent error


svn path=/trunk/boinc/; revision=24821
2011-12-17 05:36:45 +00:00
David Anderson c00cd86d2f - client: if a file download was in progress at the time of
an upgrade from 6.12 to 6.13+,
    it could get erroneously marked as an upload and get stuck forever.
    Problem: uninitialized member.


svn path=/trunk/boinc/; revision=24744
2011-12-06 16:56:27 +00:00
David Anderson ae7681c026 - client: add some missing items to CONFIG::parse_options_client().
svn path=/trunk/boinc/; revision=24598
2011-11-15 07:50:02 +00:00
David Anderson 5d29a21594 - client: on transient upload failure, don't do start_xfer()
within PERS_FILE_XFER::transient_failure();
		we're about to delete and free the FILE_XFER.
		The transfer will be restarted in the next poll.

svn path=/trunk/boinc/; revision=24549
2011-11-08 05:49:24 +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 6911932d84 - client: problem: suppose a project has 2 data servers,
and one of them is down.
    If several downloads from the broken one fail,
    we go into "project-level backoff"
    and don't start downloads from either server.
    (Same applies to uploads).

    Solution: make project-level backoff apply only to
    transfers that have already failed at least once


svn path=/trunk/boinc/; revision=24339
2011-10-06 06:13:33 +00:00
David Anderson 1383142b03 - client: use new XML parser pretty much everywhere
svn path=/trunk/boinc/; revision=23984
2011-08-11 06:17:33 +00:00
David Anderson 609d5665cc - client: pass XML_PARSER& rather than MIOFILE& to parse functions.
Preparatory to using new-style XML parsing everywhere.


svn path=/trunk/boinc/; revision=23975
2011-08-09 21:44:14 +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 ebc0bece9b - client: show HTTP errors in text form as well as number
svn path=/trunk/boinc/; revision=23528
2011-05-12 05:01:11 +00:00
David Anderson 00f7a7778b - client: on finish upload, trigger work fetch
(since we may have been waiting for upload finish)
	- client: fix crash: if remove an RSS feed, remove its active HTTP op if any.

svn path=/trunk/boinc/; revision=23097
2011-02-23 23:11:59 +00:00
David Anderson 396dc5a8b4 svn path=/trunk/boinc/; revision=22895 2011-01-12 01:17:07 +00:00
David Anderson 18f2e90929 - client: work fetch: if the chosen project is currently uploading a file,
and an upload started in the last 5 min, don't fetch work from it.
    The goal is to merge the 2 scheduler RPCs
    (fetch work, report completed taskS) into a single RPC.
    Note: this may result in idleness in some cases.
- scheduler: if client doesn't handle plan class (pre-5.10),
    check plan-class app versions anyway,
    but only use if it's a single-CPU app.
    This allows single-CPU app versions with specific requirements
    (like SSE) to be issued to old clients.
    From Bernd Machenschalk


svn path=/trunk/boinc/; revision=22841
2010-12-13 22:58:15 +00:00
David Anderson 22840960f5 - client: on resume from net bandwidth quota suspend,
apply same random backoff to all transfers.
- client: when changing ncpus via config file,
    don't modify host_info.p_ncpus
- client: show effective #CPUs separately from physical #

svn path=/trunk/boinc/; revision=21470
2010-05-12 04:00:14 +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 7daae1d0c7 - client: when emerge from bandwidth quota network suspension,
add 0..1hr random delay to existing transfers,
    to avoid DDOS effect

svn path=/trunk/boinc/; revision=21415
2010-05-07 20:08:59 +00:00
David Anderson 7db608660f - client: standardize debug messages.
Messages enabled by <foo_debug> are prefixed by "[foo]"


svn path=/trunk/boinc/; revision=21335
2010-04-29 20:32:51 +00:00
David Anderson b0cb81159f - client: when looking for new file xfers to start,
favor those that are partially done
- client: fix crashing bug if a project is detached
    while an RSS feed fetch for it is in progress
- code cleanup: switch from /// back to // for comments
    (so much for doxygen)

svn path=/trunk/boinc/; revision=21041
2010-04-01 05:54: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 dc0b76494c - client: if suspend a file xfer, set upload_offset to -1;
that way it will query server for file length when it resumes,
		rather than uploading from the beginning
	- client: back out SEH handling for GPU detection

svn path=/trunk/boinc/; revision=20750
2010-02-27 01:04:14 +00:00
David Anderson d1c1df4e60 - client: revert [19110]: don't delete files that fail verification;
they might be partly downloaded.

svn path=/trunk/boinc/; revision=19147
2009-09-23 19:44:21 +00:00
David Anderson 906dc533db - client: if a file fails verification, delete it.
svn path=/trunk/boinc/; revision=19110
2009-09-18 23:43:20 +00:00
David Anderson 1f7dec108a - client:
- remove HTTP_OP::pi; just use gstate.proxy_info
    - remove HTTP_OP::set_proxy()
    - remove PROXY_INFO::operator=; struct assignment works

svn path=/trunk/boinc/; revision=18973
2009-09-01 16:41:48 +00:00
David Anderson 9b6d6fea74 - client: fix crashing bug introduced in [18605]
svn path=/trunk/boinc/; revision=18737
2009-07-27 18:19:43 +00:00
David Anderson 75bb5a4fa9 - client: if file < 8KB, upload it in its entirety and skip size check
- client: (refinement to previous checkin)
    don't skip file size check if file has multiple upload URLs.
    We might have uploaded different amounts on different servers.

svn path=/trunk/boinc/; revision=18606
2009-07-16 20:14:57 +00:00
David Anderson 0f59eef9a7 - client: changed file upload logic
Old: each upload attempt consists of two HTTP requests:
        the 1st to get the current file size on server,
        the 2nd to upload the remainder of the file.
    Problem:
        a) if the upload server is overloaded and requests
            are succeeding with probability X,
            then the chance of both requests succeeding is X^2.
            So e.g. a per-request success rate of 0.1
            becomes an overall success rate of 0.01.
        b) the "get file size" request can be avoided in some cases.
    New:
        If we've already queried the file size
        and haven't uploaded any additional bytes,
        don't query the file size again.


svn path=/trunk/boinc/; revision=18605
2009-07-16 19:41:56 +00:00
David Anderson efc86c6b3a svn path=/trunk/boinc/; revision=18604 2009-07-16 19:11:26 +00:00
David Anderson e794e71c48 - client: code cleanup for project-level file xfer backoff
svn path=/trunk/boinc/; revision=18601
2009-07-16 16:35:57 +00:00
David Anderson 6a13bd12b8 - client: restored code for project-wide backoff on file
uploads and downloads.
    I originally added this on 30 Sept 2005
    and disabled it 2 weeks later because there were reports of problems.
    However, we need this functionality
    (e.g. on GPU hosts with hundreds of files to upload,
    we need to back off after a few failures, not try all of them).
    I added messages (<file_xfer_debug>) so you can see what's going on.
    Fixes #932.

svn path=/trunk/boinc/; revision=18593
2009-07-10 17:06:06 +00:00
David Anderson 0b3ce504ff - Win: compile fixes
svn path=/trunk/boinc/; revision=18439
2009-06-16 21:58:38 +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