Skip to content

Commit

Permalink
js resp borking
Browse files Browse the repository at this point in the history
  • Loading branch information
anthdm committed Jan 10, 2024
1 parent a03b366 commit b1b6838
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion examples/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ function respond(res, status) {
view.setUint32(4, res.length, true);

var bytes = new Uint8Array(buffer);

print(res)
print(bytes)
for (let i = 0; i < bytes.length; i++) {
putstr(String.fromCharCode(bytes[i]))
}
}

console.log("user log here")
Expand Down
2 changes: 1 addition & 1 deletion internal/actrs/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (r *Runtime) Receive(c *actor.Context) {

func (r *Runtime) initialize(msg *proto.HTTPRequest) error {
r.deploymentID = uuid.MustParse(msg.DeploymentID)
// TODO: this could be coming from a Redis cache instead of Postres.
// TODO: this could be coming from a Redis cache instead of Postgres.
// Maybe only the blob. Not sure...
deploy, err := r.store.GetDeployment(r.deploymentID)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions internal/shared/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func ParseStdout(stdout io.Reader) (logs []byte, resp []byte, status int, err er
magicStart := outLen - magicLen
status = int(binary.LittleEndian.Uint32(stdoutb[magicStart : magicStart+4]))
respLen := binary.LittleEndian.Uint32(stdoutb[magicStart+4:])
fmt.Println(status)
if int(respLen) > outLen-magicLen {
err = fmt.Errorf("response length exceeds available data")
return
Expand Down

0 comments on commit b1b6838

Please sign in to comment.