Skip to content

Commit

Permalink
Value return (#52)
Browse files Browse the repository at this point in the history
* Fix handleGet

The lab manual states that the server sends a message in the format "VALUE <name> <value> (<upper>)\n" upon receiving a  valid GET request. 
Currently, the server only returns "VALUE <value> (<upper>)\n" -> the message is missing the name of the setting. This commit fixes that issue

* Added missing space

there was a space missing from the server message.
  • Loading branch information
drumglow authored Apr 17, 2024
1 parent a97ff81 commit 79284a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unreliable_chat_check/BrokenChatServerLocal.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ func handleGet(message string, addr net.Addr, output BrokenMessageOutputStream)
if _, ok := cb.GetUser(addr); ok {
if match := regexGet.FindStringSubmatch(message); match != nil {
var b strings.Builder
b.WriteString("VALUE ")
b.WriteString(fmt.Sprintf("VALUE %s ",match[3]))
switch match[3] {
case "DROP":
b.WriteString(fmt.Sprintf("%f", localSettings.drop))
Expand Down

0 comments on commit 79284a1

Please sign in to comment.