]> saetta.ns0.it Git - libzakcgi/commitdiff
ZakCgiSession: file create immediately in costructor (closes #1024).
authorAndrea Zagli <azagli@libero.it>
Wed, 18 May 2016 15:11:46 +0000 (17:11 +0200)
committerAndrea Zagli <azagli@libero.it>
Wed, 18 May 2016 15:11:46 +0000 (17:11 +0200)
src/session.c

index d9926221e4e97d62e704dd3d27c1e48f086d3068..b5e35984f0ad96c1f5c8eaf37ab806bea61392e3 100644 (file)
@@ -161,6 +161,8 @@ ZakCgiSession
                                {
                                        zak_cgi_session_close (zak_cgi_session);
                                }
+
+                       zak_cgi_session_create_file (zak_cgi_session);
                }
 
        return zak_cgi_session;
@@ -213,7 +215,10 @@ gchar
        if (priv->sid == NULL)
                {
                        zak_cgi_session_create_file (session);
+               }
 
+       if (priv->sid != NULL)
+               {
                        ht_env = zak_cgi_main_get_env (priv->zakcgimain);
 
                        ret = zak_cgi_main_set_cookie ("ZAKCGISID", priv->sid, NULL, NULL,
@@ -512,7 +517,9 @@ zak_cgi_session_create_file (ZakCgiSession *session)
        if (iostream == NULL
                || error != NULL)
                {
-                       /* TODO */
+                       g_warning ("Unable to create the session file «%s»: %s.",
+                                          filename,
+                                          error != NULL && error->message != NULL ? error->message : "no details");
                }
        else
                {