summaryrefslogtreecommitdiffstats
path: root/conn.go
diff options
context:
space:
mode:
authorSamuel Stauffer <samuel@descolada.com>2014-03-19 22:18:21 +0100
committerSamuel Stauffer <samuel@descolada.com>2014-03-19 22:18:21 +0100
commit706c1cdc687158e370b72181f3a0e88f5156309b (patch)
tree17c4e74628a070d692655add20ee513ac5ab5a71 /conn.go
parentRemove newlines from log messages (diff)
downloadldap-706c1cdc687158e370b72181f3a0e88f5156309b.tar
ldap-706c1cdc687158e370b72181f3a0e88f5156309b.tar.gz
ldap-706c1cdc687158e370b72181f3a0e88f5156309b.tar.bz2
ldap-706c1cdc687158e370b72181f3a0e88f5156309b.tar.lz
ldap-706c1cdc687158e370b72181f3a0e88f5156309b.tar.xz
ldap-706c1cdc687158e370b72181f3a0e88f5156309b.tar.zst
ldap-706c1cdc687158e370b72181f3a0e88f5156309b.zip
Diffstat (limited to 'conn.go')
-rw-r--r--conn.go17
1 files changed, 5 insertions, 12 deletions
diff --git a/conn.go b/conn.go
index 85f993d..02fbbdc 100644
--- a/conn.go
+++ b/conn.go
@@ -226,18 +226,11 @@ func (l *Conn) processMessages() {
l.chanResults[messagePacket.MessageID] = messagePacket.Channel
// go routine
buf := messagePacket.Packet.Bytes()
- for len(buf) > 0 {
- n, err := l.conn.Write(buf)
- if err != nil {
- l.Debug.Printf("Error Sending Message: %s", err.Error())
- break
- }
- // nothing else to send
- if n == len(buf) {
- break
- }
- // the remaining buf content
- buf = buf[n:]
+
+ _, err := l.conn.Write(buf)
+ if err != nil {
+ l.Debug.Printf("Error Sending Message: %s", err.Error())
+ break
}
case MessageResponse:
l.Debug.Printf("Receiving message %d", messagePacket.MessageID)