Skip to content

Commit

Permalink
More styling changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverLok committed Aug 20, 2024
1 parent f31fc0d commit a0cc3a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/peek-submission/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ var args struct {
TargetEmail string `help:"Email of the user to fetch." arg:""`
CourseID string `help:"ID of the course." arg:""`
AssignmentID string `help:"ID of the assignment." arg:""`

TargetSubmission string `help:"ID of the submission." arg:"" optional:""`
Verbose bool `help:"Print the entire response." short:"v"`
}
Expand Down Expand Up @@ -82,15 +81,16 @@ func main() {
log.Fatal("Failed to write the request buffer to the unix server.", err)
}

sizeBuffer := make([]byte, 8)
sizeBuffer := make([]byte, config.BUFFER_SIZE.Get())

_, err = conn.Read(sizeBuffer)
if err != nil {
log.Fatal("Failed to read the size of the response buffer.", err)
}

size = binary.BigEndian.Uint64(sizeBuffer)

responseBuffer := make([]byte, size)

_, err = conn.Read(responseBuffer)
if err != nil {
log.Fatal("Failed to read the response.", err)
Expand Down
1 change: 1 addition & 0 deletions internal/api/unix_socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func handleUnixSocketConnection(conn net.Conn) error {
if err != nil {
return fmt.Errorf("Failed to generate the nonce.")
}

core.RootUserNonce.Store(randomNumber, true)
defer core.RootUserNonce.Delete(randomNumber)

Expand Down

0 comments on commit a0cc3a0

Please sign in to comment.