This commit is contained in:
Mathis Chenuet
2015-01-18 16:50:28 +01:00
committed by Laurent CLOUET
parent da5fbabb91
commit be687718c6
4 changed files with 13 additions and 13 deletions

View File

@@ -85,7 +85,7 @@ where X:
* 201 => The client does not have rendering right. * 201 => The client does not have rendering right.
* 202 => Client's session is dead. Client should do a config request before requesting a new job. * 202 => Client's session is dead. Client should do a config request before requesting a new job.
* 203 => Client's session have been disabled (usually because the client is sending broken frame). The client warms the end user and logout. * 203 => Client's session have been disabled (usually because the client is sending broken frame). The client warms the end user and logout.
* 205 => No renderer is available for Client's hardware (pair of OS and architecture). For example Blender is not avaible for MacOS 32bits. * 205 => No renderer is available for Client's hardware (pair of OS and architecture). For example Blender is not available for MacOS 32bits.
* something else => unknown error * something else => unknown error
Answer with no error: Answer with no error:

View File

@@ -481,9 +481,9 @@ public class Client {
return Error.Type.DOWNLOAD_FILE; return Error.Type.DOWNLOAD_FILE;
} }
ret = this.prepareWorkeableDirectory(ajob); // decompress renderer and scene archives ret = this.prepareWorkingDirectory(ajob); // decompress renderer and scene archives
if (ret != 0) { if (ret != 0) {
this.log.error("Client::work problem with this.prepareWorkeableDirectory (ret " + ret + ")"); this.log.error("Client::work problem with this.prepareWorkingDirectory (ret " + ret + ")");
return Error.Type.CAN_NOT_CREATE_DIRECTORY; return Error.Type.CAN_NOT_CREATE_DIRECTORY;
} }
@@ -765,7 +765,7 @@ public class Client {
return 0; return 0;
} }
protected int prepareWorkeableDirectory(Job ajob) { protected int prepareWorkingDirectory(Job ajob) {
int ret; int ret;
String renderer_archive = ajob.getRendererArchivePath(); String renderer_archive = ajob.getRendererArchivePath();
String renderer_path = ajob.getRendererDirectory(); String renderer_path = ajob.getRendererDirectory();
@@ -781,7 +781,7 @@ public class Client {
// unzip the archive // unzip the archive
ret = Utils.unzipFileIntoDirectory(renderer_archive, renderer_path); ret = Utils.unzipFileIntoDirectory(renderer_archive, renderer_path);
if (ret != 0) { if (ret != 0) {
this.gui.error("Client::prepareWorkeableDirectory, error with Utils.unzipFileIntoDirectory of the renderer (returned " + ret + ")"); this.gui.error("Client::prepareWorkingDirectory, error with Utils.unzipFileIntoDirectory of the renderer (returned " + ret + ")");
return -1; return -1;
} }
} }
@@ -800,7 +800,7 @@ public class Client {
// unzip the archive // unzip the archive
ret = Utils.unzipFileIntoDirectory(scene_archive, scene_path); ret = Utils.unzipFileIntoDirectory(scene_archive, scene_path);
if (ret != 0) { if (ret != 0) {
this.gui.error("Client::prepareWorkeableDirectory, error with Utils.unzipFileIntoDirectory of the scene (returned " + ret + ")"); this.gui.error("Client::prepareWorkingDirectory, error with Utils.unzipFileIntoDirectory of the scene (returned " + ret + ")");
return -2; return -2;
} }
} }

View File

@@ -524,14 +524,14 @@ public class Server extends Thread implements HostnameVerifier, X509TrustManager
FileOutputStream fos = new FileOutputStream(destination_); FileOutputStream fos = new FileOutputStream(destination_);
byte[] ch = new byte[512 * 1024]; byte[] ch = new byte[512 * 1024];
int nb; int nb;
long writed = 0; long written = 0;
long last_gui_update = 0; // size in byte long last_gui_update = 0; // size in byte
while ((nb = inStrm.read(ch)) != -1) { while ((nb = inStrm.read(ch)) != -1) {
fos.write(ch, 0, nb); fos.write(ch, 0, nb);
writed += nb; written += nb;
if ((writed - last_gui_update) > 1000000) { // only update the gui every 1MB if ((written - last_gui_update) > 1000000) { // only update the gui every 1MB
gui_.status(String.format(status_, (int) (100.0 * writed / size))); gui_.status(String.format(status_, (int) (100.0 * written / size)));
last_gui_update = writed; last_gui_update = written;
} }
} }
fos.close(); fos.close();

View File

@@ -151,7 +151,7 @@ public class Mac extends OS {
actual_command = Utils.concatAll(low, command); actual_command = Utils.concatAll(low, command);
} }
else { else {
Log.getInstance(null).error("No low priority binary, will not launch renderer in normal prioity"); Log.getInstance(null).error("No low priority binary, will not launch renderer in normal priority");
} }
ProcessBuilder builder = new ProcessBuilder(actual_command); ProcessBuilder builder = new ProcessBuilder(actual_command);
builder.redirectErrorStream(true); builder.redirectErrorStream(true);
@@ -177,7 +177,7 @@ public class Mac extends OS {
} }
catch (IOException e) { catch (IOException e) {
this.hasNiceBinary = false; this.hasNiceBinary = false;
Log.getInstance(null).error("Failed to find low priority binary, will not launch renderer in normal prioity (" + e + ")"); Log.getInstance(null).error("Failed to find low priority binary, will not launch renderer in normal priority (" + e + ")");
} }
finally { finally {
if (process != null) { if (process != null) {