sm.c.patch   [plain text]


--- /tmp/jabberd-2.2.13/sm/sm.c	2011-02-23 08:24:34.000000000 -0800
+++ ./jabberd2/sm/sm.c	2011-02-24 16:25:21.000000000 -0800
@@ -169,7 +169,7 @@ int sm_sx_callback(sx_t s, sx_event_t e,
                     if (ns >= 0) {
                         elem = nad_find_elem(nad, 0, ns, "starttls", 1);
                         if (elem >= 0) {
-                            if (sx_ssl_client_starttls(sm->sx_ssl, s, NULL) == 0) {
+                            if (sx_ssl_client_starttls(sm->sx_ssl, s, NULL, NULL) == 0) {
                                 nad_free(nad);
                                 return 0;
                             }
@@ -231,6 +231,7 @@ int sm_sx_callback(sx_t s, sx_event_t e,
 
         case event_CLOSED:
             mio_close(sm->mio, sm->fd);
+            sm->fd = NULL;
             return -1;
     }