~ubuntu-branches/ubuntu/lucid/boinc/lucid

« back to all changes in this revision

Viewing changes to sched/sched_timezone.C

  • Committer: Bazaar Package Importer
  • Author(s): Frank S. Thomas, Frank S. Thomas
  • Date: 2008-05-31 08:02:47 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080531080247-4ce890lp2rc768cr
Tags: 6.2.7-1
[ Frank S. Thomas ]
* New upstream release.
  - BOINC Manager: Redraw disk usage charts immediately after connecting to
    a (different) client. (closes: 463823)
* debian/copyright:
  - Added the instructions from debian/README.Debian-source about how
    repackaged BOINC tarballs can be reproduced because DevRef now
    recommends to put this here instead of in the afore-mentioned file.
  - Updated for the new release.
* Removed the obsolete debian/README.Debian-source.
* For consistency upstream renamed the core client and the command tool
  ("boinc_client" to "boinc" and "boinc_cmd" to "boinccmd"). Done the same
  in all packages and created symlinks with the old names for the binaries
  and man pages. Also added an entry in debian/boinc-client.NEWS explaining
  this change.
* debian/rules: Do not list Makefile.ins in the clean target individually,
  just remove all that can be found.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
// To view the GNU Lesser General Public License visit
16
16
// http://www.gnu.org/copyleft/lesser.html
17
17
// or write to the Free Software Foundation, Inc.,
18
 
// 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 
20
20
// Scheduler code for directing a client to one of several
21
21
// download servers based on its time zone
23
23
#include "config.h"
24
24
#include <string>
25
25
#include <stdio.h>
 
26
#include <cstring>
26
27
 
27
28
#include "parse.h"
28
29
 
112
113
    if (cached) return cached;
113
114
    
114
115
    if (!(fp=fopen("../download_servers", "r"))) {
115
 
        log_messages.printf(
116
 
            SCHED_MSG_LOG::MSG_CRITICAL,
 
116
        log_messages.printf(MSG_CRITICAL,
117
117
            "File ../download_servers not found or unreadable!\n"
118
118
        );
119
119
        return NULL;
141
141
    fclose(fp);
142
142
    
143
143
    if (!count) {
144
 
        log_messages.printf(
145
 
            SCHED_MSG_LOG::MSG_CRITICAL,
 
144
        log_messages.printf(MSG_CRITICAL,
146
145
            "File ../download_servers contained no valid entries!\n"
147
146
            "Format of this file is one or more lines containing:\n"
148
147
            "TIMEZONE_OFFSET_IN_SEC   http://some.url.path\n"
155
154
    // for details.
156
155
    qsort(cached, count, sizeof(URLTYPE), compare);
157
156
    
158
 
    log_messages.printf(
159
 
        SCHED_MSG_LOG::MSG_DEBUG,
 
157
    log_messages.printf(MSG_DEBUG,
160
158
        "Sorted list of URLs follows [host timezone: UTC%+d]\n",
161
159
        tzone
162
160
    );
163
161
    for (i=0; i<count; i++) {
164
 
        log_messages.printf(
165
 
            SCHED_MSG_LOG::MSG_DEBUG,
 
162
        log_messages.printf(MSG_DEBUG,
166
163
            "zone=%+06d url=%s\n", cached[i].zone, cached[i].name
167
164
        );
168
165
    }
265
262
    hostid=reply.host.id;
266
263
    retval = add_download_servers(avp->xml_doc, av2.xml_doc, reply.host.timezone);
267
264
    if (retval) {
268
 
        log_messages.printf(
269
 
            SCHED_MSG_LOG::MSG_CRITICAL,
 
265
        log_messages.printf(MSG_CRITICAL,
270
266
            "add_download_servers(to APP version) failed\n"
271
267
        );
272
268
        // restore original WU!
287
283
        
288
284
    retval = add_download_servers(wu2.xml_doc, wu3.xml_doc, reply.host.timezone);
289
285
    if (retval) {
290
 
        log_messages.printf(
291
 
            SCHED_MSG_LOG::MSG_CRITICAL,
 
286
        log_messages.printf(MSG_CRITICAL,
292
287
            "add_download_servers(to WU) failed\n"
293
288
        );
294
289
        // restore original WU!
296
291
    }
297
292
}
298
293
 
299
 
const char *BOINC_RCSID_28b6ac7093 = "$Id: sched_timezone.C 8896 2005-11-21 18:34:44Z korpela $";
 
294
const char *BOINC_RCSID_28b6ac7093 = "$Id: sched_timezone.C 14811 2008-02-27 23:26:38Z davea $";
300
295