all repos — honk @ e857d06e4e277639ef58f5d542f6f941178d47d4

my fork of honk

can use a prepared statement here
Ted Unangst tedu@tedunangst.com
Sun, 28 Apr 2019 22:52:40 -0400
commit

e857d06e4e277639ef58f5d542f6f941178d47d4

parent

11ef6726289c4bb31341142fd5a4a73682730cb4

1 files changed, 8 insertions(+), 3 deletions(-)

jump to
M fun.gofun.go

@@ -307,8 +307,10 @@ if err != nil {

log.Printf("error decoding %s pubkey: %s", keyname, err) return } - db.Exec("insert into xonkers (xid, ibox, obox, sbox, pubkey) values (?, ?, ?, ?, ?)", - keyname, "", "", "", data) + _, err = stmtSaveBoxes.Exec(keyname, "", "", "", data) + if err != nil { + log.Printf("error saving key: %s", err) + } } else { _, key, err = pez(data) if err != nil {

@@ -324,7 +326,10 @@ }

func makeitworksomehowwithoutregardforkeycontinuity(keyname string, r *http.Request, payload []byte) (string, error) { db := opendatabase() - db.Exec("delete from xonkers where xid = ?", keyname) + _, err := db.Exec("delete from xonkers where xid = ?", keyname) + if err != nil { + log.Printf("error deleting key: %s", err) + } ziggylock.Lock() delete(zaggies, keyname) ziggylock.Unlock()