- wrapper: compile fixes for Win

Conflicts:
	checkin_notes
This commit is contained in:
Oliver Bock 2013-03-04 15:08:51 +01:00
commit 5f8d2ac8d1
7 changed files with 94 additions and 55 deletions

View File

@ -6983,6 +6983,35 @@ David 21 Nov 2012
job.xml
wrapper.cpp
David 21 Nov 2012
- Unix build: add configure option for minimal make output
configure.ac
David 22 Nov 2012
- client: if a project is anonymous platform,
don't send list of alternate platforms in scheduler RPC.
client/
cs_platforms.cpp
David 22 Nov 2012
- scheduler: if primary platform is anonymous, ignore alternate platforms.
sched/
handle_request.cpp
David 23 Nov 2012
- client: fix uninitialized vars in CPU feature detection (from RustyBSD)
client/
hostinfo_unix.cpp
html/
inc/
submit.inc
user/
sandbox.php
David 25 Nov 2012
- wrapper: compile fixes for Win

View File

@ -316,20 +316,21 @@ void CLIENT_STATE::detect_platforms() {
// write XML list of supported platforms
//
void CLIENT_STATE::write_platforms(PROJECT* p, MIOFILE& mf) {
mf.printf(
" <platform_name>%s</platform_name>\n",
p->anonymous_platform ? "anonymous" : get_primary_platform()
);
for (unsigned int i=1; i<platforms.size(); i++) {
PLATFORM& platform = platforms[i];
if (p->anonymous_platform) {
mf.printf(" <platform_name>anonymous</platform_name>\n");
} else {
mf.printf(
" <alt_platform>\n"
" <name>%s</name>\n"
" </alt_platform>\n",
platform.name.c_str()
" <platform_name>%s</platform_name>\n", get_primary_platform()
);
for (unsigned int i=1; i<platforms.size(); i++) {
PLATFORM& platform = platforms[i];
mf.printf(
" <alt_platform>\n"
" <name>%s</name>\n"
" </alt_platform>\n",
platform.name.c_str()
);
}
}
}

View File

@ -628,9 +628,10 @@ static void parse_cpuinfo_linux(HOST_INFO& host) {
void use_cpuid(HOST_INFO& host) {
u_int p[4];
int hasMMX, hasSSE, hasSSE2, hasSSE3, has3DNow, has3DNowExt = 0;
int hasMMX, hasSSE, hasSSE2, hasSSE3, has3DNow, has3DNowExt;
char capabilities[256];
hasMMX = hasSSE = hasSSE2 = hasSSE3 = has3DNow = has3DNowExt = 0;
do_cpuid(0x0, p);
if (p[0] >= 0x1) {
@ -652,12 +653,12 @@ void use_cpuid(HOST_INFO& host) {
}
capabilities[0] = '\0';
if (hasSSE) strncat(capabilities, "sse ", 4);
if (hasSSE2) strncat(capabilities, "sse2 ", 5);
if (hasSSE3) strncat(capabilities, "sse3 ", 5);
if (has3DNow) strncat(capabilities, "3dnow ", 6);
if (has3DNowExt) strncat(capabilities, "3dnowext ", 9);
if (hasMMX) strncat(capabilities, "mmx ", 4);
if (hasSSE) strcat(capabilities, "sse ");
if (hasSSE2) strcat(capabilities, "sse2 ");
if (hasSSE3) strcat(capabilities, "sse3 ");
if (has3DNow) strcat(capabilities, "3dnow ");
if (has3DNowExt) strcat(capabilities, "3dnowext ");
if (hasMMX) strcat(capabilities, "mmx ");
strip_whitespace(capabilities);
char buf[1024];
snprintf(buf, sizeof(buf), "%s [] [%s]",
@ -1338,7 +1339,7 @@ int HOST_INFO::get_host_info() {
m_nbytes = (double)sysconf(_SC_PAGESIZE) * (double)sysconf(_SC_PHYS_PAGES);
if (m_nbytes < 0) {
msg_printf(NULL, MSG_INTERNAL_ERROR,
"RAM size not measured correctly: page size %d, #pages %d",
"RAM size not measured correctly: page size %ld, #pages %ld",
sysconf(_SC_PAGESIZE), sysconf(_SC_PHYS_PAGES)
);
}

View File

@ -16,6 +16,7 @@ AC_CANONICAL_TARGET
dnl generate .tar.gz, .tar.bz2, .zip
dnl AM_INIT_AUTOMAKE(dist-bzip2 dist-zip)
AM_INIT_AUTOMAKE(dist-zip)
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_SRCDIR(lib/shmem.cpp)

View File

@ -57,6 +57,8 @@ function req_to_xml($req, $op) {
$x .= " <mode>$file->mode</mode>\n";
switch ($file->mode) {
case "remote":
$x .= " <source>$file->source</source>\n";
break;
case "local":
$x .= " <path>$file->path</path>\n";
break;
@ -65,7 +67,7 @@ function req_to_xml($req, $op) {
case "semilocal":
$x .= " <url>$file->url</url>\n";
break;
<source>$file->source</source>
}
$x .= " </input_file>\n";
}
$x .= " </job>

View File

@ -52,7 +52,7 @@ function list_files($user, $err_msg) {
</form>
<hr>
";
if(strcmp($err_msg,"")!=0){
if (strcmp($err_msg,"")!=0){
echo "<p>$err_msg<hr>";
}
$files = array();
@ -67,7 +67,7 @@ function list_files($user, $err_msg) {
sort($files);
start_table();
table_header("Name<br><span class=note>(click to view)</span>", "Modified", "Size (bytes)", "MD5", "Delete","Download");
foreach($files as $f) {
foreach ($files as $f) {
$path = "$dir/$f";
list($error, $size, $md5) = sandbox_parse_link_file($path);
if ($error) {
@ -102,36 +102,36 @@ function list_files($user, $err_msg) {
function upload_file($user) {
$tmp_name = $_FILES['new_file']['tmp_name'];
if (is_uploaded_file($tmp_name)) {
$name = $_FILES['new_file']['name'];
if (strstr($name, "/")) {
error_page("no / allowed");
}
$md5 = md5_file($tmp_name);
$s = stat($tmp_name);
$size = $s['size'];
list($exist,$elf) = sandbox_lf_exist($user,$md5);
if ($exist){
$notice = "<strong>Notice:</strong> Invalid Upload<br/>";
$notice .= "You are trying to upload file <strong>$name</strong><br/>";
$notice .= "Another file <strong>$elf</strong> with the same content(md5: $md5) already exist!<br/>";
list_files($user,$notice);
return;
} else{
// move file to download dir
//
$phys_path = sandbox_physical_path($user, $md5);
rename($tmp_name, $phys_path);
if (!is_uploaded_file($tmp_name)) {
error_page("$tmp_name is not uploaded file");
}
$name = $_FILES['new_file']['name'];
if (strstr($name, "/")) {
error_page("no / allowed");
}
$md5 = md5_file($tmp_name);
$s = stat($tmp_name);
$size = $s['size'];
list($exist, $elf) = sandbox_lf_exist($user, $md5);
if ($exist){
$notice = "<strong>Notice:</strong> Invalid Upload<br/>";
$notice .= "You are trying to upload file <strong>$name</strong><br/>";
$notice .= "Another file <strong>$elf</strong> with the same content(md5: $md5) already exist!<br/>";
} else{
// move file to download dir
//
$phys_path = sandbox_physical_path($user, $md5);
rename($tmp_name, $phys_path);
// write link file
//
$dir = sandbox_dir($user);
$link_path = "$dir/$name";
sandbox_write_link_file($link_path, $size, $md5);
// write link file
//
$dir = sandbox_dir($user);
$link_path = "$dir/$name";
sandbox_write_link_file($link_path, $size, $md5);
$notice = "Successfully uploaded file <strong>$name</strong>!<br/>";
list_files($user,$notice);
}
}
list_files($user, $notice);
}
function delete_file($user) {
@ -145,7 +145,7 @@ function delete_file($user) {
if (!is_file($p)) {
error_page("no such physical file");
}
$bused = sandbox_file_in_use($user,$name);
$bused = sandbox_file_in_use($user, $name);
if ($bused){
$notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>";
} else{
@ -161,14 +161,14 @@ function download_file($user) {
$name = get_str('name');
$dir = sandbox_dir($user);
list($err, $size, $md5) = sandbox_parse_link_file("$dir/$name");
if($err) {
if ($err) {
error_page("can't parse link file");
}
$p = sandbox_physical_path($user, $md5);
if (!is_file($p)) {
error_page("$p does not exist!");
}
do_download($p,$name);
do_download($p, $name);
}
function view_file($user) {
$name = get_str('name');

View File

@ -1236,9 +1236,14 @@ void process_request(char* code_sign_key) {
//
platform = ssp->lookup_platform(g_request->platform.name);
if (platform) g_request->platforms.list.push_back(platform);
for (i=0; i<g_request->alt_platforms.size(); i++) {
platform = ssp->lookup_platform(g_request->alt_platforms[i].name);
if (platform) g_request->platforms.list.push_back(platform);
// if primary platform is anonymous, ignore alternate platforms
//
if (strcmp(g_request->platform.name, "anonymous")) {
for (i=0; i<g_request->alt_platforms.size(); i++) {
platform = ssp->lookup_platform(g_request->alt_platforms[i].name);
if (platform) g_request->platforms.list.push_back(platform);
}
}
if (g_request->platforms.list.size() == 0) {
sprintf(buf, "%s %s",