Modify the connection accept logic
authorDoHyun Pyun <dh79.pyun@samsung.com>
Sat, 1 Sep 2012 04:39:35 +0000 (13:39 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Sat, 1 Sep 2012 04:39:35 +0000 (13:39 +0900)
[Comment] It is possible to return the timeout error in normal case

Change-Id: Iabb9f781d8e6689edbf21173386f9e19639977f5

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

index cc88e334f480198bba826fe91a1bf8c1c103e205..36f69cf7671917d7ea66504664177a12878c02eb 100644 (file)
@@ -1,3 +1,11 @@
+bluetooth-frwk (0.1.86) unstable; urgency=low
+
+  * Tagging and upload the package
+  * Git: slp/pkgs/b/bluetooth-frwk
+  * Tag: bluetooth-frwk_0.1.86
+
+ -- DoHyun Pyun <dh79.pyun@samsung.com>  Sat, 01 Sep 2012 13:32:17 +0900
+
 bluetooth-frwk (0.1.85) unstable; urgency=low
 
   * Tagging and upload the package
index 7729126777173b09e15ca9f3e50e344cb2ade894..ff4b55d34d8aaf86316cef3bdc83866cc479af54 100644 (file)
@@ -512,21 +512,16 @@ 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, FALSE);
                usleep(SLEEP_TIME); /* Sleep 50ms */
                block_time += SLEEP_TIME;
 
-               if (block_time >= BLOCK_MAX_TIMEOUT) {
-                       g_main_context_iteration(NULL, FALSE);
+               if (block_time >= BLOCK_MAX_TIMEOUT)
                        return BLUETOOTH_ERROR_TIMEOUT;
-               }
        }
 
-       g_main_context_iteration(NULL, FALSE);
-
        obex_connected = FALSE;
        auto_authorize = FALSE;
 
index 98654bad66b95581aca6ff59a7fef1728e9d85fd..6ca3489bf96b23cd555ae6117851b22819dd6f5b 100644 (file)
@@ -1311,21 +1311,16 @@ 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, FALSE);
                usleep(SLEEP_TIME); /* Sleep 50ms */
                block_time += SLEEP_TIME;
 
-               if (block_time >= BLOCK_MAX_TIMEOUT) {
-                       g_main_context_iteration(NULL, FALSE);
+               if (block_time >= BLOCK_MAX_TIMEOUT)
                        return BLUETOOTH_ERROR_TIMEOUT;
-               }
        }
 
-       g_main_context_iteration(NULL, FALSE);
-
        *client_fd = connected_fd;
        rfcomm_connected = FALSE;
 
index 2b264217e26254e2365c28d1a42cd277ad1eb019..d193edd0b96c1966cd28eff9c910d0aed56a1524 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.85
+Version:    0.1.86
 Release:    1
 Group:      TO_BE/FILLED_IN
 License:    TO BE FILLED IN