Permalink
Browse files

Fix Content-Length

  • Loading branch information...
1 parent 6ee3f6d commit 93561c63ba691404628f6be84bfa066e1c40d22f @richcollins richcollins committed Nov 20, 2010
Showing with 105 additions and 34 deletions.
  1. +1 −1 client/VertexClient.js
  2. +13 −4 lib/Vertex/Log.js
  3. +1 −1 lib/Vertex/Vertex.js
  4. +1 −1 tests/correctness/VertexTest.js
  5. +1 −1 tests/speed/VertexSpeedTest.js
  6. +88 −26 vertex.js.tmproj
@@ -149,7 +149,7 @@ VertexClient = Proto.clone().newSlots({
var headers = {
'Host': this._host,
"Content-Type": "application/json-request",
- "Content-Length": this._body.length
+ "Content-Length": Buffer.byteLength(this._body.toString(), "utf8")
};
if(this._username)
View
@@ -1,10 +1,19 @@
-Log = Proto.clone().setSlots({
+var util = require('util');
+
+Log = Proto.clone().newSlots({
+ exception: null
+}).setSlots({
writeln: function()
{
var args = Arguments_asArray(arguments);
- var now = new Date;
- args.prepend(now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate() + " " + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds() + "." + now.getMilliseconds())
- writeln(args.join("\t"));
+ //var now = new Date;
+ //args.prepend(now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate() + " " + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds() + "." + now.getMilliseconds())
+ util.log(args.join(""));
+ if(this.exception())
+ {
+ writeln(this.exception().stack);
+ this.setException(null);
+ }
return this;
}
})
@@ -392,7 +392,7 @@ Vertex = Proto.clone().newSlots({
this.updateIdleTimerIfNeeded();
- //Log.writeln(new Date().getTime() - startDate.getTime() + "ms", request.url);
+ Log.writeln(new Date().getTime() - startDate.getTime(), "ms\t", request.url);
},
@@ -56,7 +56,7 @@ TestRequest = Proto.clone().newSlots({
{
'host': '127.0.0.1',
"Content-Type": "application/json-request",
- "Content-Length": body.length,
+ "Content-Length": Buffer.byteLength(body.toString(), "utf8"),
"Cookie": "ignoreAddons=true"
//"Cookie": "user=flynn; password=raindeerfloatilla;"
});
@@ -44,7 +44,7 @@ TestRequest = Proto.clone().newSlots({
{
'host': '127.0.0.1',
"Content-Type": "application/json-request",
- "Content-Length": body.length
+ "Content-Length": Buffer.byteLength(body.toString(), "utf8")
//"Cookie": "user=guest; password=guest;"
});
View
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>currentDocument</key>
- <string>lib/Crux/Proto.js</string>
+ <string>lib/Vertex/PRecord.js</string>
<key>documents</key>
<array>
<dict>
@@ -51,50 +51,64 @@
<key>firstVisibleLine</key>
<integer>0</integer>
</dict>
- <key>addons/VertexUI/HtmlView.js</key>
+ <key>addons/VertexUI/HtmlDocument.js</key>
<dict>
<key>caret</key>
<dict>
<key>column</key>
- <integer>2</integer>
+ <integer>0</integer>
<key>line</key>
- <integer>239</integer>
+ <integer>0</integer>
</dict>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
- <integer>212</integer>
+ <integer>22</integer>
</dict>
- <key>addons/VertexUI/LBPostsView.js</key>
+ <key>addons/VertexUI/HtmlView.js</key>
<dict>
<key>caret</key>
<dict>
<key>column</key>
- <integer>14</integer>
+ <integer>38</integer>
<key>line</key>
- <integer>84</integer>
+ <integer>420</integer>
</dict>
<key>columnSelection</key>
<false/>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
- <integer>57</integer>
+ <integer>409</integer>
<key>selectFrom</key>
<dict>
<key>column</key>
- <integer>6</integer>
+ <integer>25</integer>
<key>line</key>
- <integer>84</integer>
+ <integer>420</integer>
</dict>
<key>selectTo</key>
<dict>
<key>column</key>
- <integer>14</integer>
+ <integer>38</integer>
<key>line</key>
- <integer>84</integer>
+ <integer>420</integer>
</dict>
</dict>
+ <key>addons/VertexUI/LBInboxView.js</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>4</integer>
+ <key>line</key>
+ <integer>104</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>73</integer>
+ </dict>
<key>addons/VertexUI/ListView.js</key>
<dict>
<key>caret</key>
@@ -114,14 +128,14 @@
<key>caret</key>
<dict>
<key>column</key>
- <integer>0</integer>
+ <integer>41</integer>
<key>line</key>
- <integer>0</integer>
+ <integer>179</integer>
</dict>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
- <integer>173</integer>
+ <integer>148</integer>
</dict>
<key>addons/VertexUI/PathView.js</key>
<dict>
@@ -172,14 +186,14 @@
<key>caret</key>
<dict>
<key>column</key>
- <integer>2</integer>
+ <integer>0</integer>
<key>line</key>
- <integer>54</integer>
+ <integer>134</integer>
</dict>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
- <integer>17</integer>
+ <integer>104</integer>
</dict>
<key>lib/Crux/Array.js</key>
<dict>
@@ -376,34 +390,82 @@
<key>caret</key>
<dict>
<key>column</key>
- <integer>4</integer>
+ <integer>6</integer>
<key>line</key>
- <integer>455</integer>
+ <integer>243</integer>
</dict>
+ <key>columnSelection</key>
+ <false/>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
- <integer>433</integer>
+ <integer>217</integer>
+ <key>selectFrom</key>
+ <dict>
+ <key>column</key>
+ <integer>1</integer>
+ <key>line</key>
+ <integer>243</integer>
+ </dict>
+ <key>selectTo</key>
+ <dict>
+ <key>column</key>
+ <integer>6</integer>
+ <key>line</key>
+ <integer>243</integer>
+ </dict>
+ </dict>
+ <key>lib/Vertex/PRecord.js</key>
+ <dict>
+ <key>caret</key>
+ <dict>
+ <key>column</key>
+ <integer>2</integer>
+ <key>line</key>
+ <integer>24</integer>
+ </dict>
+ <key>firstVisibleColumn</key>
+ <integer>0</integer>
+ <key>firstVisibleLine</key>
+ <integer>0</integer>
</dict>
<key>lib/Vertex/Vertex.js</key>
<dict>
<key>caret</key>
<dict>
<key>column</key>
- <integer>3</integer>
+ <integer>22</integer>
<key>line</key>
- <integer>590</integer>
+ <integer>331</integer>
</dict>
+ <key>columnSelection</key>
+ <false/>
<key>firstVisibleColumn</key>
<integer>0</integer>
<key>firstVisibleLine</key>
- <integer>559</integer>
+ <integer>311</integer>
+ <key>selectFrom</key>
+ <dict>
+ <key>column</key>
+ <integer>15</integer>
+ <key>line</key>
+ <integer>331</integer>
+ </dict>
+ <key>selectTo</key>
+ <dict>
+ <key>column</key>
+ <integer>28</integer>
+ <key>line</key>
+ <integer>331</integer>
+ </dict>
</dict>
</dict>
<key>openDocuments</key>
<array>
<string>lib/Vertex/PNode.js</string>
+ <string>lib/Vertex/PRecord.js</string>
<string>addons/VertexUI/VertexUI.js</string>
+ <string>addons/VertexUI/HtmlDocument.js</string>
<string>lib/Vertex/Vertex.js</string>
<string>lib/Vertex/Log.js</string>
<string>addons/VertexUI/ButtonView.js</string>
@@ -413,7 +475,7 @@
<string>addons/VertexUI/NodeView.js</string>
<string>lib/Crux/Proto.js</string>
<string>lib/Crux/Object.js</string>
- <string>addons/VertexUI/LBPostsView.js</string>
+ <string>addons/VertexUI/LBInboxView.js</string>
<string>lib/NodeCrux/String+Path.js</string>
<string>lib/Crux/String+Path.js</string>
<string>addons/VertexUI/PathView.js</string>

0 comments on commit 93561c6

Please sign in to comment.