Skip to content

Removing the appending of the method name to an RPC call #1593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 11, 2016

Conversation

Eosis
Copy link
Contributor

@Eosis Eosis commented Mar 7, 2016

The RPC call appended the method name to the output after the method
had already finished processing. It was unexpected for my use case,
and doesn't feel like the obvious thing to do. This could be appended
in the RPC method itself, instead.

The adding of the method to the output was first commited in commit
556b889.

The RPC call appended the method name to the output after the method
had already finished processing. It was unexpected for my use case,
and doesn't feel like the obvious thing to do.  This could be appended
in the RPC method itself, instead.

The adding of the method to the output was first commited in commit
556b889.
@0xc0170
Copy link
Contributor

0xc0170 commented Mar 8, 2016

Can you please sign http://developer.mbed.org/contributor_agreement/ ? And share your nick there, seems it does not match the github one.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 8, 2016

What's your use case? How this change does affect the current applications?

cc @sarahmarshy @sg-

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 24, 2016

@Eosis I could not locate you on the mbed.org website (to check CLA), however this is trivial one line change..

@Eosis
Copy link
Contributor Author

Eosis commented Apr 1, 2016

I've accepted the agreement, you should see it on the email that the commit was made by. :)

I'm using the RPC call output buffer to send back a text response to a web browser, this response was being suffixed with the RPC method name which led to incorrect formatting in the web browser.

Prior to this commit, if the response I populated in my own RPC function call by calling the putData method on the Reply was "200 OK", I would instead get back "200 OK ".

Ie, for an RPCFunction called EchoBack, Bound to the string "RpcEchoBack",

void EchoBack(mbed::Arguments */*input*/, mbed::Reply *output) {
    output->putData("200 OK");
}

Would lead to the output buffer being filled with "200 OKRpcEchoBack", when I expected "200 OK".

If you merge this, then use cases which rely on seeing the name of the RPC Function that was called at the end of the output string would be upset, though this would be easily rectified by appending it in the method itself.

@0xc0170 0xc0170 removed the needs: cla label Apr 5, 2016
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 5, 2016

Thnanks for the clarification. This patch looks sensible. @sarahmarshy seems not to be around to provide details of this addition. I would like to get one more vote for this to be accepted.

@sarahmarshy
Copy link
Contributor

I think this is the best approach. Best to leave that functionality to the method itself.

@0xc0170 0xc0170 merged commit 02b197c into ARMmbed:master Apr 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants