Properly export Debug and add Network to Conn

This commit is contained in:
raylu 2010-10-15 18:11:14 -04:00
parent 38b846f9d7
commit 90a5268dfa
1 changed files with 4 additions and 3 deletions

View File

@ -17,6 +17,7 @@ type Conn struct {
// Connection Hostname and Nickname // Connection Hostname and Nickname
Host string Host string
Me *Nick Me *Nick
Network string
// I/O stuff to server // I/O stuff to server
sock net.Conn sock net.Conn
@ -34,7 +35,7 @@ type Conn struct {
// Set this to true to disable flood protection and false to re-enable // Set this to true to disable flood protection and false to re-enable
Flood bool Flood bool
debug bool Debug bool
// Event handler mapping // Event handler mapping
events map[string][]func(*Conn, *Line) events map[string][]func(*Conn, *Line)
@ -167,7 +168,7 @@ func (conn *Conn) send() {
break break
} }
conn.io.Flush() conn.io.Flush()
if conn.debug { if conn.Debug {
fmt.Println("-> " + line) fmt.Println("-> " + line)
} }
} }
@ -184,7 +185,7 @@ func (conn *Conn) recv() {
} }
// chop off \r\n // chop off \r\n
s = s[0 : len(s)-2] s = s[0 : len(s)-2]
if conn.debug { if conn.Debug {
fmt.Println("<- " + s) fmt.Println("<- " + s)
} }