Monotone-Parent: 1ff8d61cb974903310a23626bb38b87a13f84358

Monotone-Revision: 3ed608f2d193596ff9ea26138010a888e87b0929

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-01-22T16:43:46
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-01-22 16:43:46 +00:00
parent 2cd79f0e5e
commit 3037de35a9
3 changed files with 15 additions and 2 deletions

View File

@@ -398,6 +398,7 @@ function uixDeleteSelectedContacts(sender) {
http = createHTTPClient();
http.open("POST", url, false /* not async */);
http.send("");
http.setRequestHeader("Content-Length", 0);
if (http.status != 200) { /* request failed */
failCount++;
http = null;

View File

@@ -1261,6 +1261,7 @@ function updateTaskStatus(event) {
http.open("POST", url, false /* not async */);
http.url = url;
http.send("");
http.setRequestHeader("Content-Length", 0);
if (isHttpStatus204(http.status))
refreshTasks();
} else

View File

@@ -334,7 +334,7 @@ function triggerAjaxRequest(url, callback, userdata, content, headers) {
checkAjaxRequestsState();
}
}
catch( e ) {
catch (e) {
activeAjaxRequests -= 1;
checkAjaxRequestsState();
log("AJAX Request, Caught Exception: " + e.name);
@@ -342,9 +342,19 @@ function triggerAjaxRequest(url, callback, userdata, content, headers) {
log(backtrace());
}
};
var hasContentLength = false;
if (headers) {
for (var i in headers)
for (var i in headers) {
if (i.toLowerCase() == "content-length")
hasContentLength = true;
http.setRequestHeader(i, headers[i]);
}
}
if (!hasContentLength) {
var cLength = "0";
if (content)
cLength = "" + content.length;
http.setRequestHeader("Content-Length", "" + cLength);
}
http.send(content);
}
@@ -1355,6 +1365,7 @@ function loadPreferences() {
var http = createHTTPClient();
http.open("GET", url, false);
http.send("");
if (http.status == 200) {
if (http.responseText.length > 0)
userDefaults = http.responseText.evalJSON(true);