ecore_con : fix server security type and loop_quit timing
authorJunsuChoi <jsuya.choi@samsung.com>
Fri, 18 May 2018 09:49:31 +0000 (18:49 +0900)
committerYeongjong Lee <yj34.lee@samsung.com>
Fri, 13 Jul 2018 10:51:56 +0000 (19:51 +0900)
   In SSL test, server should not be SSL_CLASS in already.
   ecore_main_loop_quit() of upgrade_del() is never reached.
   so When the upgrade is finished, call ecore_main_loop_quit()

Change-Id: I2f887de55d8d51a5d1f1dae4628c57cb5b19a6a3

TC/ecore/ecore_con/utc_ecore_con_ssl.c

index 5e1a8d8becb17842716bfdabee0f12407dc89d24..4218ffaa4440b717dab4aac864912894b539118e 100644 (file)
@@ -227,14 +227,26 @@ _data(void *data, int type EINA_UNUSED, void *ev)
 static Eina_Bool
 _server_upgrade(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED)
 {
+   Ecore_Con_Event_Server_Add *event = ev;
    server_upgraded = EINA_TRUE;
+   if (client_upgraded)
+     {
+        ecore_con_server_del(event->server);
+        ecore_main_loop_quit();
+     }
    return EINA_FALSE;
 }
 
 static Eina_Bool
 _client_upgrade(void *data EINA_UNUSED, int type EINA_UNUSED, void *ev EINA_UNUSED)
 {
+   Ecore_Con_Event_Client_Add *event = ev;
    client_upgraded = EINA_TRUE;
+   if (server_upgraded)
+     {
+        ecore_con_server_del(ecore_con_client_server_get(event->client));
+        ecore_main_loop_quit();
+     }
    return EINA_FALSE;
 }
 
@@ -343,7 +355,6 @@ _upgrade_del(void *data , int type EINA_UNUSED, void *ev)
           }
 
         ecore_con_server_del(event->server);
-        ecore_main_loop_quit();
      }
 
    return ECORE_CALLBACK_RENEW;
@@ -797,7 +808,7 @@ START_TEST(utc_ecore_con_ssl_upgrade)
 {
    int server_port = 1111;
    const char *name = "127.0.0.1";
-   Ecore_Con_Type compl_type =  ECORE_CON_REMOTE_TCP | ECORE_CON_LOAD_CERT | ECORE_CON_USE_MIXED;
+   Ecore_Con_Type compl_type =  ECORE_CON_REMOTE_TCP;
    Ecore_Con_Server *server = NULL;
    Ecore_Con_Server *client;
    Ecore_Event_Handler *handlers[8];