Skip to content

Commit

Permalink
* exporting sanitize request from helper.js
Browse files Browse the repository at this point in the history
* making ack a number when we get a request
  • Loading branch information
satyamshekhar committed Feb 14, 2012
1 parent f607e99 commit 2a3cf22
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/helper.js
Expand Up @@ -152,11 +152,13 @@ function get_stream_name(node) {
// about.
function sanitize_request_node(node) {
// TODO: Implement
if (node.attrs.rid) {
node.attrs.rid = toNumber(node.attrs.rid);
}

// In case node doesn't have attrs.rid it will be set to 0, which
// is alright.
node.attrs.rid = toNumber(node.attrs.rid);

if (node.attrs.ack) {
node.attrs.ack = toNumber(node.attrs.ack);
}
return node;
}

Expand Down Expand Up @@ -208,3 +210,4 @@ exports.is_stream_restart_packet = is_stream_restart_packet;
exports.is_stream_add_request = is_stream_add_request;
exports.is_stream_terminate_request = is_stream_terminate_request;
exports.is_session_creation_packet = is_session_creation_packet;
exports.sanitize_request_node = sanitize_request_node;

1 comment on commit 2a3cf22

@dhruvbird
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tying up the lose ends - I have lost track of a lot of the intricacies involved in making a change!

Please sign in to comment.