Small tweaks for server

This commit is contained in:
Simon Kornblith 2012-04-09 01:59:49 -04:00
parent 77ea5bf3f9
commit 6d4a435838
4 changed files with 26 additions and 13 deletions

@ -1 +1 @@
Subproject commit 843dcc3b3f1f16ab317a9551be7446e098a9a7ee
Subproject commit 296b81717c02f9f30315fdd8c93759cc7f5b2869

View file

@ -33,7 +33,8 @@ Zotero.Server = new function() {
404:"Not Found",
412:"Precondition Failed",
500:"Internal Server Error",
501:"Method Not Implemented"
501:"Method Not Implemented",
504:"Gateway Timeout"
};
/**
@ -381,6 +382,12 @@ Zotero.Server.DataListener.prototype._processEndpoint = function(method, postDat
* returns HTTP data from a request
*/
Zotero.Server.DataListener.prototype._requestFinished = function(response) {
if(this._requestFinished) {
Zotero.debug("Request already finished; not sending another response");
return;
}
this._requestFinished = true;
// close input stream
this.iStream.close();

View file

@ -211,17 +211,21 @@ Zotero.Utilities.Translate.prototype.processDocuments = function(urls, processor
try {
exception(e);
} catch(e) {
try {
Zotero.Browser.deleteHiddenBrowser(hiddenBrowser);
} catch(e) {}
if(hiddenBrowser) {
try {
Zotero.Browser.deleteHiddenBrowser(hiddenBrowser);
} catch(e) {}
}
translate.complete(false, e);
}
}
} else {
var myException = function(e) {
try {
Zotero.Browser.deleteHiddenBrowser(hiddenBrowser);
} catch(e) {}
if(hiddenBrowser) {
try {
Zotero.Browser.deleteHiddenBrowser(hiddenBrowser);
} catch(e) {}
}
translate.complete(false, e);
}
}
@ -268,10 +272,12 @@ Zotero.Utilities.Translate.prototype.processDocuments = function(urls, processor
function() {
if(done) done();
var handler = function() {
try {
Zotero.Browser.deleteHiddenBrowser(hiddenBrowser);
translate.removeHandler("done", handler);
} catch(e) {}
if(hiddenBrowser) {
try {
Zotero.Browser.deleteHiddenBrowser(hiddenBrowser);
} catch(e) {}
}
translate.removeHandler("done", handler);
};
translate.setHandler("done", handler);
translate.decrementAsyncProcesses("Zotero.Utilities.Translate#processDocuments");

@ -1 +1 @@
Subproject commit 6dfd753bb5dfabca0837d2b57c93c0c41afa7d0a
Subproject commit 7d5618f579aeed406fd39c9a97f9ad0dfb22ece2