Commit Graph

59 Commits

Author SHA1 Message Date
David Anderson 8cd8c8e7ee server software: handle 64-bit database IDs
The SETI@home result table is about to run out of 32-bit IDs,
so we need to move to 64-bit result IDs.
This will happen to the workunit table at some point too.

I changed the server C++ code to use the "long" type for all DB IDs
(and to use appropriate conversion codes like %lu).
"long" is 64 bit on 64-bit machines.
For uniformity I did this for all tables,
even ones (like app) that will never get big.

I chose NOT to change the DB schema for now.
The new code will work with 32-bit ID fields in the DB.
As projects approach the 32-bit limit on a table they can change
its ID field, and fields that reference this table, to BIGINT.
This is likely to happen only on the result and workunit tables.
I put functions in html/ops/db_update.php
to change the IDs of these tables.
2015-07-23 10:11:08 -07:00
David Anderson db501739a6 client: timestamp all writes to stderr 2014-11-14 13:07:24 -08:00
David Anderson 846b8c7757 all components: change strcpy() to strlcpy() when possible.
This commit should cover the client and manager code.
2013-06-03 20:24:48 -07:00
David Anderson f25cf0836a Include <cmath> instead of <math.h> various places 2013-05-27 16:44:22 -07:00
David Anderson 8009a8cecb Condor interface: various fixes, mostly from Jaime Frey
- XML parser: for parse_string(), malloc the 256KB buffer instead of
    allocating it on the stack; the latter crashes threads with 32KB stacks.
    However, do the malloc() only if we've actually seen the start tag
    (this required a bit of code shuffle).
- BOINC GAHP: escape spaces in error msgs
2013-05-27 11:45:10 -07:00
David Anderson c6d79d1172 client: fix bug that could cause client to never contact project
if a project sends us <no_rsc_apps> flags for all processor types,
then by default the client will never do a scheduler RPC to that project again.
This could happen because of a transient condition in the project,
e.g. it deprecates all its app versions for a while.

To avoid this situation, the client now checks whether the no_rsc_apps flags
are set for all processor types.
If they are, it clears them all.
This will cause work fetch to use backoff,
and the client will occasionally contact the project.
2013-05-17 10:25:03 -07:00
David Anderson 4927acf25a scheduler: fix bug in copying long XML elements 2013-05-08 15:34:37 -07:00
David Anderson 93b8289b60 - XML parser: return error if string exceeds buffer size.
- client: when parsing MD5, use 64 instead of 33 char buffer.
    When the XML parser reads a string,
    it enforces the buffer size limit BEFORE it strips whitespace.
    So if a project put whitespaces before or after the MD5,
    it would fail to parse.
2013-03-29 22:36:53 -07:00
David Anderson 39780bd105 - XML parser: when skipping unrecognized elements,
don't read them into memory.
2013-03-22 10:32:57 +01:00
David Anderson cff84a8ae2 - server: remove debugging printf from XML parser 2013-03-15 13:38:45 +01:00
David Anderson e07fa5e28c - client (and maybe others): fix XML parsing bug when skipping large
unrecognized elements
2013-03-15 13:38:44 +01:00
David Anderson 2fea038249 - Scheduler: fix security vulnerabilities 2013-03-07 11:28:42 +01:00
David Anderson 4bf3f7f51a - client: fix copy_element_contents() to remove assumption that the
end tag is on a line by itself.  (this broke things if gui_urls.xml
    didn't end with a CRLF).
2013-03-05 16:31:44 +01:00
David Anderson 6391a8c401 - remote job submission: show 20 batches, with link to show all
- XML parser: make low-level functions inline, in an attempt
    (unsuccessful, as far as I can tell) to boost performance
2013-03-01 16:26:08 +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 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 39f5dc7e58 - client: fix bug in reading reason for temporary exit
- lib: fix a valgrind warning


svn path=/trunk/boinc/; revision=25499
2012-03-27 20:52:25 +00:00
David Anderson 6e1414a07f - scheduler: increase buffer for global prefs from 8K to 64K
- lay the groundwork for changing it to std::string


svn path=/trunk/boinc/; revision=24595
2011-11-15 00:11:12 +00:00
Jeff Cobb 2e526a0956 server: more fixes to DB to handle unsigned result IDs
svn path=/trunk/boinc/; revision=24564
2011-11-09 20:24:48 +00:00
David Anderson ddc859c0b3 - client simulator: bug fix
svn path=/trunk/boinc/; revision=24437
2011-10-19 17:45:10 +00:00
David Anderson 3410abef6f - backend API: added function cancel_jobs(minid, maxid)
for canceling jobs
- added program cancel_jobs for canceling jobs
- DB interface: it's not an error if update_fields_noid()
    affects != 1 rows


svn path=/trunk/boinc/; revision=24413
2011-10-18 07:15:04 +00:00
Eric J. Korpela b0c0daa8ce -Fixed bug in xml_unescape() that caused a segfault if an entity of the form
&#NNN; was truncated.

svn path=/trunk/boinc/; revision=24409
2011-10-17 23:13:13 +00:00
David Anderson 57fc54ae53 - lib: move XML parse test program to its own file.
Note: XML_PARSER::parse_str() doesn't currently work right
    for something like <foo><a>xx</a></foo>.
    It should return "<a>xx</a>".
    TODO.


svn path=/trunk/boinc/; revision=24325
2011-10-03 21:43:34 +00:00
David Anderson c544a81742 - Win fixes
svn path=/trunk/boinc/; revision=24233
2011-09-18 21:28:31 +00:00
David Anderson a2f6b62d97 - lib: parse <available_ram> in coproc XML
- lib: do coproc XML parsing using new XML parser


svn path=/trunk/boinc/; revision=24215
2011-09-15 04:24:40 +00:00
David Anderson 9dddcdb10c - XML parsing: do XML unescaping in place rather than allocating
a buffer on the stack.
    Fixes a Manager crash on the Mac,
    where the default thread stack size seems to be 512KB.


svn path=/trunk/boinc/; revision=24206
2011-09-14 17:58:53 +00:00
David Anderson 4e8177eb04 - client: fix error in parsing of XML comments
svn path=/trunk/boinc/; revision=24156
2011-09-11 05:41:46 +00:00
David Anderson e9d37aa65e - client: XML-escape the URLs in RSS feed lists
- lib: make xml_unescape work for arbitrarily large strings


svn path=/trunk/boinc/; revision=24154
2011-09-09 20:13:35 +00:00
David Anderson 699ae76f8e - client: new XML parser had a limit of 8KB for strings.
This broke things.  Increase it to 256KB.


svn path=/trunk/boinc/; revision=24147
2011-09-09 06:50:00 +00:00
David Anderson abdb603bc4 - job creation: handling of extra XML in input templates didn't work.
- job creation: fix stripping of <output_template> tags
- client: fix off-by-1 error in buffer overflow logic for scanning keys.


svn path=/trunk/boinc/; revision=24057
2011-08-27 16:52:04 +00:00
David Anderson 2fa2ae125b svn path=/trunk/boinc/; revision=23979 2011-08-10 17:58:16 +00:00
David Anderson c5c5975b44 - Improve interface of XML_PARSER.
Add parsed_tag and is_tag to the class,
    so that parsing functions don't need to declare them
    and pass them around.
- Complete the task of using XML_PARSER as the argument
    to all parsing functions.
    (Internally, many of these functions still use the old XML parser;
    that's the next step.)


svn path=/trunk/boinc/; revision=23978
2011-08-10 17:11:08 +00:00
David Anderson bfc04f03eb - back end: fix bugs in [23648] which caused create_work
to mess up input templates containing
    <copy_file/> or other attribute tags.
    XML_PARSER now contains a member element() for when
    you want to copy an element without knowing its structure.


svn path=/trunk/boinc/; revision=23790
2011-07-04 23:51:00 +00:00
David Anderson 1afde126cb - client: escape only non-ASCII chars in stderr out, not control chars
svn path=/trunk/boinc/; revision=23601
2011-05-25 16:40:19 +00:00
David Anderson b24bfbba3d - manager: fix the above to detect premature EOF correctly
svn path=/trunk/boinc/; revision=23259
2011-03-25 13:24:03 +00:00
David Anderson 3db221b912 - manager: fix crashing bug when notices (or other text parsed by XML_PARSER)
contain non-ASCII characters.
		Rom: please port to 6.12

svn path=/trunk/boinc/; revision=23255
2011-03-25 09:41:10 +00:00
David Anderson ded867aa25 - create_work and possibly other back-end programs:
fix bug that corrupted WU command lines.
    The problem: we were using strcpy(p, p+n) to delete the
    first n characters of p.
    This is incorrect - the behavior of strcpy() is undefined
    if its args overlap.
    On some systems (e.q. AQUA's server) it does wacky things.


svn path=/trunk/boinc/; revision=23007
2011-02-09 00:21:40 +00:00
David Anderson eeab2aee92 - simulator work
- fix some indentation

svn path=/trunk/boinc/; revision=22891
2011-01-07 20:23:22 +00:00
David Anderson e0e237d4dc - debug the above. It now successfully displays an
RSS feed of news items from Google,
		linked from a project manager

svn path=/trunk/boinc/; revision=22326
2010-09-08 21:13:14 +00:00
Charlie Fenton 049c50586c lib: fix compiler warnings
svn path=/trunk/boinc/; revision=22014
2010-07-20 10:15:11 +00:00
Charlie Fenton ecddbe3cad lib: fix compiler warnings
svn path=/trunk/boinc/; revision=22013
2010-07-20 10:10:25 +00:00
David Anderson 0c948a656a - client: init gstate.now early so that initial msgs have timestamps
- lib: fix the above

svn path=/trunk/boinc/; revision=22012
2010-07-20 04:19:22 +00:00
David Anderson 2d2a7cd8ce - lib: XML_PARSER::parse_str(): if text is enclosed in ![CDATA[,
don't entity-unescape it


svn path=/trunk/boinc/; revision=22011
2010-07-20 03:10:56 +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 564cd7cece - Notices: put message bodies inside CDATA
- XML_PARSER: handle CDATA

svn path=/trunk/boinc/; revision=20146
2010-01-13 05:32:11 +00:00
David Anderson 36b04b6279 - client: further work on notices.
The RSS feed part of it is mostly working.
- client: fix bug in XML_PARSER (tags with attributes weren't
    parsed correctly if no attribute buffer supplied)

svn path=/trunk/boinc/; revision=20026
2009-12-23 17:18:13 +00:00
David Anderson a762e222cc - client: if downloaded project list file is garbage, ignore it.
- all: accept <foo /> as an XML bool

svn path=/trunk/boinc/; revision=19220
2009-09-30 17:13:45 +00:00
David Anderson dbd7b8b8e9 - client: when writing XML, entity-encode the following fields:
FILE_INFO::url
    HOST_INFO::p_vendor, p_model, p_features, os_name, os_version

    The following fields are already entity-encoded:
    PROJECT::user_name, team_name
    APP_INIT_DATA::user_name, team_name
    PROXY_INFO:: user names and passwds

    These are (as far as I know) the only fields that can
    contain special chars.
    This is now documented in:
    http://boinc.berkeley.edu/trac/wiki/XmlNotes
- client: XML_PARSER::parse_str() now does xml_unescape(),
    same as ::parse_str().


svn path=/trunk/boinc/; revision=18915
2009-08-25 21:32:39 +00:00
David Anderson 563a55f37e - client/libs/samples: remove "#define read _read" etc. from boinc_win.h
These cause problems when "read" is a member name, etc.
		Do these #defines, conditioned on _MSC_VER,
		in the files that actually need them.
	- don't include boinc_win.h from parse.h.
		principle of minimal inclusion

svn path=/trunk/boinc/; revision=18902
2009-08-22 17:00:19 +00:00