mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=2167
This commit is contained in:
parent
47c59c55a4
commit
5959bfc0e8
|
@ -5873,7 +5873,7 @@ Karl 2003/08/20
|
|||
- allow for header to not have to be a single TCP message
|
||||
- parse line-by-line instead of full-header strstr for efficiency
|
||||
- compare header names case insensitively
|
||||
- test scripts
|
||||
- test scripts: no longer need apache or any environment variables.
|
||||
|
||||
client/
|
||||
http.C
|
||||
|
|
|
@ -58,9 +58,6 @@ void handle_wu(DB_WORKUNIT& wu) {
|
|||
time_t now = time(0), x;
|
||||
bool all_over, have_result_to_validate, do_delete;
|
||||
|
||||
log_messages.printf(SchedMessages::DEBUG, "[WU#%d %s] handling WU\n", wu.id, wu.name);
|
||||
ScopeMessages scope_messages(log_messages, SchedMessages::NORMAL);
|
||||
|
||||
// scan the results for the WU
|
||||
//
|
||||
sprintf(buf, "where workunitid=%d", wu.id);
|
||||
|
@ -68,18 +65,11 @@ void handle_wu(DB_WORKUNIT& wu) {
|
|||
results.push_back(result);
|
||||
}
|
||||
|
||||
// if (results.size() == 0) {
|
||||
// log_messages.printf(
|
||||
// SchedMessages::NORMAL, "[WU#%d %s] No results\n",
|
||||
// wu.id, wu.name
|
||||
// );
|
||||
// return;
|
||||
// }
|
||||
|
||||
log_messages.printf(SchedMessages::DEBUG,
|
||||
"[WU#%d %s] enumerated %d results\n",
|
||||
wu.id, wu.name, (int)results.size()
|
||||
);
|
||||
log_messages.printf(
|
||||
SchedMessages::DEBUG, "[WU#%d %s] handling WU: enumerated %d results\n",
|
||||
wu.id, wu.name,
|
||||
(int)results.size());
|
||||
ScopeMessages scope_messages(log_messages, SchedMessages::NORMAL);
|
||||
|
||||
// count up the number of results in various states,
|
||||
// and check for timed-out results
|
||||
|
|
|
@ -27,10 +27,9 @@ class PHPHTTPRequestHandler(CGIHTTPServer.CGIHTTPRequestHandler):
|
|||
if self.path.find('.php') != -1:
|
||||
self.cgi_info = os.path.split(self.path)
|
||||
return True
|
||||
# return CGIHTTPServer.CGIHTTPRequestHandler.is_cgi(self)
|
||||
|
||||
for p in self.cgi_directories:
|
||||
p = os.path.join(p,'/')
|
||||
p = os.path.join(p,'')
|
||||
if self.path.startswith(p):
|
||||
self.cgi_info = os.path.split(self.path)
|
||||
return True
|
||||
|
@ -167,82 +166,14 @@ class PHPHTTPRequestHandler(CGIHTTPServer.CGIHTTPRequestHandler):
|
|||
pass
|
||||
os.dup2(self.rfile.fileno(), 0)
|
||||
os.dup2(self.wfile.fileno(), 1)
|
||||
if is_php:
|
||||
os.chdir(self.translate_path(dir))
|
||||
os.chdir(self.translate_path(dir)) # KC
|
||||
os.execve(scriptfile, args, os.environ)
|
||||
except:
|
||||
self.server.handle_error(self.request, self.client_address)
|
||||
os._exit(127)
|
||||
|
||||
elif self.have_popen2 or self.have_popen3:
|
||||
# Windows -- use popen2 or popen3 to create a subprocess
|
||||
import shutil
|
||||
if self.have_popen3:
|
||||
popenx = os.popen3
|
||||
else:
|
||||
popenx = os.popen2
|
||||
cmdline = scriptfile
|
||||
if self.is_python(scriptfile):
|
||||
interp = sys.executable
|
||||
if interp.lower().endswith("w.exe"):
|
||||
# On Windows, use python.exe, not pythonw.exe
|
||||
interp = interp[:-5] + interp[-4:]
|
||||
cmdline = "%s -u %s" % (interp, cmdline)
|
||||
if '=' not in query and '"' not in query:
|
||||
cmdline = '%s "%s"' % (cmdline, query)
|
||||
self.log_message("command: %s", cmdline)
|
||||
try:
|
||||
nbytes = int(length)
|
||||
except (TypeError, ValueError):
|
||||
nbytes = 0
|
||||
files = popenx(cmdline, 'b')
|
||||
fi = files[0]
|
||||
fo = files[1]
|
||||
if self.have_popen3:
|
||||
fe = files[2]
|
||||
if self.command.lower() == "post" and nbytes > 0:
|
||||
data = self.rfile.read(nbytes)
|
||||
fi.write(data)
|
||||
# throw away additional data [see bug #427345]
|
||||
while select.select([self.rfile._sock], [], [], 0)[0]:
|
||||
if not self.rfile._sock.recv(1):
|
||||
break
|
||||
fi.close()
|
||||
shutil.copyfileobj(fo, self.wfile)
|
||||
if self.have_popen3:
|
||||
errors = fe.read()
|
||||
fe.close()
|
||||
if errors:
|
||||
self.log_error('%s', errors)
|
||||
sts = fo.close()
|
||||
if sts:
|
||||
self.log_error("CGI script exit status %#x", sts)
|
||||
else:
|
||||
self.log_message("CGI script exited OK")
|
||||
|
||||
else:
|
||||
# Other O.S. -- execute script in this process
|
||||
save_argv = sys.argv
|
||||
save_stdin = sys.stdin
|
||||
save_stdout = sys.stdout
|
||||
save_stderr = sys.stderr
|
||||
try:
|
||||
try:
|
||||
sys.argv = [scriptfile]
|
||||
if '=' not in decoded_query:
|
||||
sys.argv.append(decoded_query)
|
||||
sys.stdout = self.wfile
|
||||
sys.stdin = self.rfile
|
||||
execfile(scriptfile, {"__name__": "__main__"})
|
||||
finally:
|
||||
sys.argv = save_argv
|
||||
sys.stdin = save_stdin
|
||||
sys.stdout = save_stdout
|
||||
sys.stderr = save_stderr
|
||||
except SystemExit, sts:
|
||||
self.log_error("CGI script exit status %s", str(sts))
|
||||
else:
|
||||
self.log_message("CGI script exited OK")
|
||||
raise SystemExit('need fork()')
|
||||
|
||||
def serve(bind='', port=8000, handler=PHPHTTPRequestHandler):
|
||||
setup_php(os.path.realpath(os.path.dirname(sys.argv[0])))
|
||||
|
|
|
@ -43,7 +43,7 @@ def test_init():
|
|||
|
||||
options.program_path = os.path.realpath(os.path.dirname(sys.argv[0]))
|
||||
|
||||
options.auto_setup = int(get_env_var("BOINC_TEST_AUTO_SETUP",0))#######
|
||||
options.auto_setup = int(get_env_var("BOINC_TEST_AUTO_SETUP",1))#######
|
||||
options.user_name = get_env_var("BOINC_TEST_USER_NAME", '') or get_env_var("USER")
|
||||
options.delete_testbed = get_env_var("BOINC_TEST_DELETE", 'if-successful').lower()
|
||||
options.install_method = get_env_var("BOINC_TEST_INSTALL_METHOD", 'symlink').lower()
|
||||
|
@ -633,7 +633,10 @@ def delete_test():
|
|||
'''Delete all test data'''
|
||||
if options.auto_setup and hasattr(options,'auto_setup_basedir'):
|
||||
verbose_echo(1, "Deleting testbed %s."%options.auto_setup_basedir)
|
||||
shutil.rmtree(options.auto_setup_basedir)
|
||||
try:
|
||||
shutil.rmtree(options.auto_setup_basedir)
|
||||
except e:
|
||||
verbose_echo(0, "Couldn't delete testbed %s: %s"%(options.auto_setup_basedir,e))
|
||||
|
||||
class Proxy:
|
||||
def __init__(self, code, cgi=0, html=0, start=1):
|
||||
|
|
Loading…
Reference in New Issue