all repos — honk @ e36bbfba4a31da0cf3abfde4acffbcfc6dee3b9b

my fork of honk

context timeout for postmsg
Ted Unangst tedu@tedunangst.com
Sat, 09 May 2020 19:25:25 -0400
commit

e36bbfba4a31da0cf3abfde4acffbcfc6dee3b9b

parent

017e2f0d06d7c16fb618c8497c9c8decf932f62a

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M activity.goactivity.go

@@ -17,6 +17,7 @@ package main

import ( "bytes" + "context" "database/sql" "errors" "fmt"

@@ -69,6 +70,9 @@ }

req.Header.Set("User-Agent", "honksnonk/5.0; "+serverName) req.Header.Set("Content-Type", theonetruename) httpsig.SignRequest(keyname, key, req, msg) + ctx, cancel := context.WithTimeout(context.Background(), 1 * time.Minute) + defer cancel() + req = req.WithContext(ctx) resp, err := client.Do(req) if err != nil { return err