Fix the Jira issue (N_SE-6825)
authorDoHyun Pyun <dh79.pyun@samsung.com>
Sat, 1 Sep 2012 00:54:30 +0000 (09:54 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Sat, 1 Sep 2012 00:54:30 +0000 (09:54 +0900)
[Issue] N_SE-6825

[Problem] Lockup after accepting connection

[Cause] Call g_main_context_iteration function many times

[Solution] Call g_main_context_iteration fucntion once

Change-Id: I8018e2216ce06d95b4dedf038fb82970e37f7495

debian/changelog
lib/bluetooth-obex-server-api.c
lib/bluetooth-rfcomm-api.c
packaging/bluetooth-frwk.spec

index 1fd9427868b9349385d9ddace123330745d88fbf..cc88e334f480198bba826fe91a1bf8c1c103e205 100644 (file)
@@ -1,3 +1,11 @@
+bluetooth-frwk (0.1.85) unstable; urgency=low
+
+  * Tagging and upload the package
+  * Git: slp/pkgs/b/bluetooth-frwk
+  * Tag: bluetooth-frwk_0.1.85
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com>  Sat, 01 Sep 2012 09:06:39 +0900
+
 bluetooth-frwk (0.1.84) unstable; urgency=low
 
   * Tagging and upload the package
index ac775cf79055635575fe42c66b694dcf68f06543..7729126777173b09e15ca9f3e50e344cb2ade894 100644 (file)
@@ -512,16 +512,21 @@ BT_EXPORT_API int bluetooth_obex_server_accept_connection(void)
        obex_connected = FALSE;
        auto_authorize = TRUE;
 
+       g_main_context_iteration(NULL, TRUE);
+
        /* Block until recieve the event (Requirement from BADA) */
        while (obex_connected == FALSE) {
-               g_main_context_iteration(NULL, TRUE);
                usleep(SLEEP_TIME); /* Sleep 50ms */
                block_time += SLEEP_TIME;
 
-               if (block_time >= BLOCK_MAX_TIMEOUT)
+               if (block_time >= BLOCK_MAX_TIMEOUT) {
+                       g_main_context_iteration(NULL, FALSE);
                        return BLUETOOTH_ERROR_TIMEOUT;
+               }
        }
 
+       g_main_context_iteration(NULL, FALSE);
+
        obex_connected = FALSE;
        auto_authorize = FALSE;
 
index a9e471a708586f79c18d19fbadc2e75110256990..98654bad66b95581aca6ff59a7fef1728e9d85fd 100644 (file)
@@ -1311,16 +1311,21 @@ BT_EXPORT_API int bluetooth_rfcomm_accept_connection(int server_fd, int *client_
                goto done;
        }
 
+       g_main_context_iteration(NULL, TRUE);
+
        /* Block until recieve the event (Requirement from BADA) */
        while (rfcomm_connected == FALSE) {
-               g_main_context_iteration(NULL, TRUE);
                usleep(SLEEP_TIME); /* Sleep 50ms */
                block_time += SLEEP_TIME;
 
-               if (block_time >= BLOCK_MAX_TIMEOUT)
+               if (block_time >= BLOCK_MAX_TIMEOUT) {
+                       g_main_context_iteration(NULL, FALSE);
                        return BLUETOOTH_ERROR_TIMEOUT;
+               }
        }
 
+       g_main_context_iteration(NULL, FALSE);
+
        *client_fd = connected_fd;
        rfcomm_connected = FALSE;
 
index 0ffa3460eae07387016968d1c24d1fc453b0b8e2..2b264217e26254e2365c28d1a42cd277ad1eb019 100644 (file)
@@ -1,6 +1,6 @@
 Name:       bluetooth-frwk
 Summary:    Bluetooth framework for BlueZ and Obexd. This package is Bluetooth framework based on BlueZ and Obexd stack.
-Version:    0.1.84
+Version:    0.1.85
 Release:    1
 Group:      TO_BE/FILLED_IN
 License:    TO BE FILLED IN