Skip to content

Commit

Permalink
fix: Create packet function
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Nov 10, 2023
1 parent 70f380d commit 39b1bbb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func process_req(buf []byte, conn net.Conn) {
}

fmt.Printf("%s: %s [%d] %s \n", title, commandsName[int(req.CommandID)],
int(req.CommandID), strings.Replace(data, "\x00", "", -1))
int(req.CommandID), strings.Replace(data, "\x00", "", -1))

// if it's a req and need a response
if req.IsReq == 1 && req.NeedResponse == 1 {
Expand Down Expand Up @@ -363,7 +363,7 @@ func write(w http.ResponseWriter, r *http.Request) {
ok(w, "")
}

func packet(req REQ, data string) [4096]byte{
func packet(req REQ, data string) []byte {

buf := make([]byte, 0, 4096)
writer := bytes.NewBuffer(buf)
Expand Down

0 comments on commit 39b1bbb

Please sign in to comment.