cleanup, put backreference to SASL plug in library
[cyrus-sasl.git] / lib / server.c
index 1533c10..59c61ff 100644 (file)
@@ -1427,6 +1427,7 @@ int sasl_server_step(sasl_conn_t *conn,
     if(serverout) *serverout = NULL;
     if(serveroutlen) *serveroutlen = 0;
 
+    s_conn->sparams->plug = s_conn->mech->m.plug;
     ret = s_conn->mech->m.plug->mech_step(conn->context,
                                        s_conn->sparams,
                                        clientin,
@@ -1435,10 +1436,12 @@ int sasl_server_step(sasl_conn_t *conn,
                                        serveroutlen,
                                        &conn->oparams);
 
+    s_conn->sparams->plug = NULL;
     if (ret == SASL_OK) {
        ret = do_authorization(s_conn);
     }
 
+
     if (ret == SASL_OK) {
        /* if we're done, we need to watch out for the following:
         * 1. the mech does server-send-last