Skip to content
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

web100clt.c: make results parsing more robust #217

Merged
merged 1 commit into from
Feb 17, 2017
Merged

web100clt.c: make results parsing more robust #217

merged 1 commit into from
Feb 17, 2017

Conversation

bassosimone
Copy link
Contributor

@bassosimone bassosimone commented Jan 7, 2017

  1. Do not assume that the first line we receive contains a space

  2. Do not assume that the first line we receive contains an integer

  3. Be robust to the case where input is an empty string

  4. Do not assume that after the first token delimited by space we will find a second token delimited by newline

Tested under the following conditions:

a) web100clt -n ndt.iupui.mlab1.trn01.measurement-lab.org that sends back all variables and checked via printf() that the variables that are parsed by the new code are the ones received in resultstr

b) web100clt -n neubot.mlab.mlab1.mil01.measurement-lab.org that at the moment is running botticelli v0.0.5 (which is buggy and doesn't send any MSG_RESULTS messages) and make sure it does not crash

c) web100clt -n neubot.mlab.mlab1.trn01.measurement-lab.org that at the moment is running botticelli v0.0.6 (which sends a single dummy variable not considered by NDT) and make sure it doesn't crash

Note that a) and c) did not changed after this patch. What this patch changes is the behavior in case b).

[Edit: forgot to mention that, when I tested, in my NDT tree there was #216 applied, otherwise b) and c) would have failed due to segmentation fault caused by accessing a non-initialized string.]

xref: neubot/botticelli#18.

1) Do not assume that the first line we receive contains a space

2) Do not assume that the first line we receive contains an integer

3) Be robust to the case where input is an empty string

4) Do not assume that after the first token delimited by space we
   will find a second token delimited by newline

Tested under the following conditions:

a) web100clt -n ndt.iupui.mlab1.trn01.measurement-lab.org that sends
   back all variables and checked via printf() that the variables that
   are parsed by the new code are the ones received in resultstr

b) web100clt -n neubot.mlab.mlab1.mil01.measurement-lab.org that at
   the moment is running botticelli v0.0.5 (which is buggy and doesn't
   send any MSG_RESULTS messages) and make sure it does not crash

c) web100clt -n neubot.mlab.mlab1.trn01.measurement-lab.org that at
   the moment is running botticelli v0.0.6 (which sends a single
   dummy variable not considered by NDT) and make sure it doesn't crash

Note that a) and c) did not changed after this patch. What this patch
changes is the behavior in case b).

xref: neubot/botticelli#18.
@pboothe
Copy link
Contributor

pboothe commented Feb 17, 2017

Thanks again for making web100clt more robust!

@pboothe pboothe merged commit 70ff8bc into ndt-project:master Feb 17, 2017
@bassosimone bassosimone deleted the fix/results_parsing branch February 17, 2017 17:12
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.

2 participants