@@ -142,28 +142,19 @@ xmpp_conn_t *xmpp_conn_new(xmpp_ctx_t *ctx)
142142
143143 conn = strophe_alloc (ctx , sizeof (xmpp_conn_t ));
144144 if (conn != NULL ) {
145+ memset (conn , 0 , sizeof (xmpp_conn_t ));
145146 conn -> ctx = ctx ;
146147
147148 conn -> type = XMPP_UNKNOWN ;
148149 conn -> state = XMPP_STATE_DISCONNECTED ;
149150
150- conn -> xsock = NULL ;
151151 conn -> sock = INVALID_SOCKET ;
152152 conn -> ka_timeout = KEEPALIVE_TIMEOUT ;
153153 conn -> ka_interval = KEEPALIVE_INTERVAL ;
154154 conn -> ka_count = KEEPALIVE_COUNT ;
155- conn -> tls = NULL ;
156- conn -> timeout_stamp = 0 ;
157- conn -> error = 0 ;
158- conn -> stream_error = NULL ;
159155
160156 /* default send parameters */
161- conn -> blocking_send = 0 ;
162157 conn -> send_queue_max = DEFAULT_SEND_QUEUE_MAX ;
163- conn -> send_queue_len = 0 ;
164- conn -> send_queue_user_len = 0 ;
165- conn -> send_queue_head = NULL ;
166- conn -> send_queue_tail = NULL ;
167158
168159 /* default timeouts */
169160 conn -> connect_timeout = CONNECT_TIMEOUT ;
@@ -173,49 +164,14 @@ xmpp_conn_t *xmpp_conn_new(xmpp_ctx_t *ctx)
173164 strophe_free (conn -> ctx , conn );
174165 return NULL ;
175166 }
176- conn -> domain = NULL ;
177- conn -> jid = NULL ;
178- conn -> pass = NULL ;
179- conn -> stream_id = NULL ;
180- conn -> bound_jid = NULL ;
181-
182- conn -> is_raw = 0 ;
183- conn -> tls_support = 0 ;
184- conn -> tls_disabled = 0 ;
185- conn -> tls_mandatory = 0 ;
186- conn -> tls_legacy_ssl = 0 ;
187- conn -> tls_trust = 0 ;
188- conn -> tls_failed = 0 ;
189- conn -> tls_cafile = NULL ;
190- conn -> tls_capath = NULL ;
191- conn -> tls_client_cert = NULL ;
192- conn -> tls_client_key = NULL ;
193- conn -> sasl_support = 0 ;
194- conn -> auth_legacy_enabled = 0 ;
195- conn -> secured = 0 ;
196- conn -> certfail_handler = NULL ;
197- conn -> password_callback = NULL ;
198- conn -> password_callback_userdata = NULL ;
199167 tls_clear_password_cache (conn );
200168 conn -> password_retries = 1 ;
201169
202- conn -> bind_required = 0 ;
203- conn -> session_required = 0 ;
204- conn -> sm_state = NULL ;
205-
206170 conn -> parser =
207171 parser_new (conn -> ctx , _handle_stream_start , _handle_stream_end ,
208172 _handle_stream_stanza , conn );
209- conn -> reset_parser = 0 ;
210-
211- conn -> stream_negotiation_completed = 0 ;
212- conn -> conn_handler = NULL ;
213- conn -> userdata = NULL ;
214- conn -> timed_handlers = NULL ;
215173 /* we own (and will free) the hash values */
216174 conn -> id_handlers = hash_new (conn -> ctx , 32 , NULL );
217- conn -> handlers = NULL ;
218- conn -> sockopt_cb = NULL ;
219175
220176 /* give the caller a reference to connection */
221177 conn -> ref = 1 ;
@@ -1154,6 +1110,7 @@ long xmpp_conn_get_flags(const xmpp_conn_t *conn)
11541110 XMPP_CONN_FLAG_MANDATORY_TLS * conn -> tls_mandatory |
11551111 XMPP_CONN_FLAG_LEGACY_SSL * conn -> tls_legacy_ssl |
11561112 XMPP_CONN_FLAG_TRUST_TLS * conn -> tls_trust |
1113+ XMPP_CONN_FLAG_DISABLE_SM * conn -> sm_disable |
11571114 XMPP_CONN_FLAG_LEGACY_AUTH * conn -> auth_legacy_enabled ;
11581115
11591116 return flags ;
0 commit comments