equal
deleted
inserted
replaced
71 // TODO Send readXml a reader that we can close when we |
71 // TODO Send readXml a reader that we can close when we |
72 // negotiate TLS. |
72 // negotiate TLS. |
73 go readXml(cl.tcp, cl.in, debug) |
73 go readXml(cl.tcp, cl.in, debug) |
74 go writeXml(cl.tcp, cl.out, debug) |
74 go writeXml(cl.tcp, cl.out, debug) |
75 |
75 |
|
76 // Initial handshake. |
|
77 hsOut := &Stream{To: jid.Domain, Version: Version} |
|
78 cl.Out <- hsOut |
|
79 |
76 return cl, nil |
80 return cl, nil |
77 } |
81 } |
78 |
82 |
79 func (c *Client) Close() os.Error { |
83 func (c *Client) Close() os.Error { |
80 close(c.in) |
84 close(c.in) |
123 } |
127 } |
124 ch <- st |
128 ch <- st |
125 continue |
129 continue |
126 case "stream error": |
130 case "stream error": |
127 obj = &StreamError{} |
131 obj = &StreamError{} |
|
132 case nsStream + " features": |
|
133 obj = &Features{} |
128 default: |
134 default: |
129 obj = &Unrecognized{} |
135 obj = &Unrecognized{} |
|
136 log.Printf("Ignoring unrecognized: %s %s\n", |
|
137 se.Name.Space, se.Name.Local) |
130 } |
138 } |
131 |
139 |
132 // Read the complete XML stanza. |
140 // Read the complete XML stanza. |
133 err = p.Unmarshal(obj, &se) |
141 err = p.Unmarshal(obj, &se) |
134 if err != nil { |
142 if err != nil { |