2
0

Access underlying net.Conn via method

Also remove some dead code.
This commit is contained in:
Jack Christensen
2018-12-31 18:00:08 -06:00
parent af2fc36c27
commit 1ff8024df9
7 changed files with 51 additions and 83 deletions
+5 -5
View File
@@ -157,7 +157,7 @@ func (ct *copyFrom) run() (int, error) {
sentCount += addedRows
pgio.SetInt32(buf[sp:], int32(len(buf[sp:])))
_, err = ct.conn.pgConn.NetConn.Write(buf)
_, err = ct.conn.pgConn.Conn().Write(buf)
if err != nil {
panicked = false
ct.conn.die(err)
@@ -181,7 +181,7 @@ func (ct *copyFrom) run() (int, error) {
buf = append(buf, copyDone)
buf = pgio.AppendInt32(buf, 4)
_, err = ct.conn.pgConn.NetConn.Write(buf)
_, err = ct.conn.pgConn.Conn().Write(buf)
if err != nil {
panicked = false
ct.conn.die(err)
@@ -256,7 +256,7 @@ func (ct *copyFrom) cancelCopyIn() error {
buf = append(buf, 0)
pgio.SetInt32(buf[sp:], int32(len(buf[sp:])))
_, err := ct.conn.pgConn.NetConn.Write(buf)
_, err := ct.conn.pgConn.Conn().Write(buf)
if err != nil {
ct.conn.die(err)
return err
@@ -304,7 +304,7 @@ func (c *Conn) CopyFromReader(r io.Reader, sql string) (CommandTag, error) {
buf = buf[0 : n+5]
pgio.SetInt32(buf[sp:], int32(n+4))
if _, err := c.pgConn.NetConn.Write(buf); err != nil {
if _, err := c.pgConn.Conn().Write(buf); err != nil {
return "", err
}
}
@@ -313,7 +313,7 @@ func (c *Conn) CopyFromReader(r io.Reader, sql string) (CommandTag, error) {
buf = append(buf, copyDone)
buf = pgio.AppendInt32(buf, 4)
if _, err := c.pgConn.NetConn.Write(buf); err != nil {
if _, err := c.pgConn.Conn().Write(buf); err != nil {
return "", err
}