Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/labs/oob1.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ <h2>Task Information</h2>
if the minimum length of a response <tt>(1 + 2 + 16)</tt> is more than
the length claimed by
<tt>s->s3->rrec.length</tt>,
and return 0 without sending a heartbeat,
then return 0 without sending a heartbeat,
This will prevent trying to create a heartbeat when there's not enough
room to create a heartbeat at all.
<p>
Second, modify the code so that
if the minimum length of a response with a payload
<tt>(1 + 2 + payload + 16</tt>
<tt>(1 + 2 + payload + 16)</tt>
is more than the total length for a response given in
<tt>s->s3->rrec.length</tt> then again
return 0 without sending a heartbeat,
return 0 without sending a heartbeat.
<p>
This will prevent trying to create a heartbeat when there's not enough
room to create one and there was a payload to return as a heartbeat.
Expand Down
60 changes: 51 additions & 9 deletions docs/labs/oob1.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,66 @@ info =
{
hints: [
{
absent: "if",
text: "Begin with \"if\" as we will return 0 when there is a problem."
absent: "^ if",
text: "Begin with \"if\" as we will return 0 when there is a problem.",
examples: [
[ " foo " ],
],
},
{
absent: String.raw`\(`,
text: "Need \"(...)\" around the condition after an if statement."
absent: String.raw`\(.*\)`,
text: "Need \"(...)\" around the condition after an if statement.",
examples: [
[ " if " ],
],
},
{
absent: ">",
text: "Need comparison \"if ( ... > ....)\""
absent: "[<>]",
text: "Need comparison \"if ( ... > ....)\"",
examples: [
[ " if ( x )" ],
],
},
{
absent: String.raw`s -> s3 -> rrec \. length`,
text: "Need to compare a value with s->s3->rrec.length"
text: "Need to compare a value with s->s3->rrec.length",
examples: [
[ " if ( length > 3 )" ],
],
},
{
absent: "return",
text: "Need \"return 0;\" to skip attempts to send a too-long response."
absent: "return 0 ;",
text: "Need \"return 0;\" to skip attempts to send a too-long response.",
},
{
absent: "^ if",
text: "Begin with \"if\" as we will return 0 when there is a problem.",
index: 1,
},
{
absent: String.raw`\(.*\)`,
text: "Need \"(...)\" around the condition after an if statement.",
index: 1,
},
{
absent: "[<>]",
text: "Need comparison \"if ( ... > ....)\"",
index: 1,
},
{
absent: String.raw`s -> s3 -> rrec \. length`,
text: "Need to compare a value with s->s3->rrec.length",
index: 1,
},
{
absent: "return 0 ;",
text: "Need \"return 0;\" to skip attempts to send a too-long response.",
index: 1,
},
{
absent: "payload",
text: "Need to consider the payload length.",
index: 1,
},
],
definitions: [
Expand Down