Skip to content

Commit

Permalink
more node api fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
orlandov committed Feb 20, 2010
1 parent 7b27f8a commit ac8c48d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -12,8 +12,9 @@ SYNOPSIS
port: 8098,
});

// store nyarlathotep in deities as plain text with an 'r' value of 1
db.store('deities', 'nyarlathotep', "The crawling chaos", { r: 1 })
// store nyarlathotep in deities as plain text with an 'r' value of 1, and
// return the content again (content is not returned by default)
db.store('deities', 'nyarlathotep', "The crawling chaos", { returnbody: 1, r: 1 })
.addCallback(function (resp, statusCode) {
// ...
});
Expand Down
2 changes: 1 addition & 1 deletion lib/riak.js
Expand Up @@ -110,7 +110,7 @@ Client.prototype.makeRequest = function(method, url, headers, data) {
var request = this.client.request(method, url, headers);
var promise = new process.Promise();

if (data) request.sendBody(data);
if (data) request.write(data);

request.addListener('response', function (response) {
var body = "";
Expand Down
4 changes: 2 additions & 2 deletions tests/test_walk.js
Expand Up @@ -56,11 +56,11 @@ function parseMessage(resp) {
var body = message.body;
process.nextTick(function s () {
if (body) {
message.emit("body", body.substr(0, chunkSize));
message.emit("data", body.substr(0, chunkSize));
body = body.substr(chunkSize);
process.nextTick(s);
} else {
message.emit("complete");
message.emit("end");
}
});
}
Expand Down

0 comments on commit ac8c48d

Please sign in to comment.