summaryrefslogtreecommitdiff
path: root/src/session.c
AgeCommit message (Collapse)AuthorFilesLines
2011-10-21session: Do not select ongoing service againDaniel Wagner1-0/+5
In case Session.Connect() is called several times while the selected services is still going from the IDLE state to ONLINE state (or error state), do not call select_and_connect() again. This leads to an inconsistent ref counting on the service. Fixes BMC#23630
2011-09-30session: Set dirty flag in de/select service functionDaniel Wagner1-14/+18
2011-09-30session: Remove double assignmentDaniel Wagner1-2/+0
The dirty flag is already cleared in append_notify()
2011-09-30session: Handle bearers update correctlyDaniel Wagner1-17/+28
We cannot create a new service_list in populate_service_list while we still hold pointers to entries (session->entry). deselect_and_disconnect() would then operate on bogus pointers leading to memory corruption Fixes BMC#23325
2011-09-30session: Rename update_allowed_bearers()Daniel Wagner1-3/+3
2011-09-30session: Move update_allowed_bearers() upDaniel Wagner1-75/+75
2011-09-22Use 'cellular' instead of '3g' as bearer nameDaniel Wagner1-3/+3
Fixes BMC#23324
2011-09-22session: Move info->online update code to session_changed()Daniel Wagner1-12/+7
service_state_changed() should only update the service states. session_changed() takes care of all session settings.
2011-09-22session: Remove unnecessary deselect_serviceDaniel Wagner1-8/+1
Because in session_changed() we take care of this now.
2011-09-22session: Simplefy session_changed()Daniel Wagner1-36/+6
Since we are tracking the reason code now also in the deslect_and_disconnect() function we can rely on the correct handling there. Also no need to parse the reason code again.
2011-09-22session: Add reason code to deselect_and_disconnect()Daniel Wagner1-8/+12
2011-09-22session: Add debug messagesDaniel Wagner1-1/+6
2011-09-22session: Add CONNMAN_SESSION_REASON_DISCONNECTDaniel Wagner1-2/+7
Maybe the reason code should be renamed to state
2011-09-22session: Pass session_info pointer into functionsDaniel Wagner1-23/+16
2011-09-22session: Remove deselect_previous_service()Daniel Wagner1-8/+3
The deselect_and_disconnect() function should be called from session_changed() and not in the select_and_connect() code path. All disconnect and connect decision are initiate from session_changed(). This makes the code flow more symetric. Note that we break here a Online -> Offline transision, we are going to fix this later again.
2011-09-22session: Rename test_and_disconnectDaniel Wagner1-8/+8
To deselect_and_disconnect in order to match more to the select_and_connect function.
2011-09-22session: Track info not the session for ecallDaniel Wagner1-12/+14
This is a prepartion step for the next few patches. Instead of passing the session pointer into functions we are going to pass in only the session_info pointer.
2011-09-22session: Disconnect free ride sessionDaniel Wagner1-0/+2
In case where we get offline Fixes BMC#22837
2011-09-22session: Refactor select_serviceDaniel Wagner1-16/+37
Split the online/offline code path with moving the corresponding code into two new functions.
2011-09-22session: Fix null pointer derefencingDaniel Wagner1-1/+3
When an emergency session sets back the EmergencyCall property, all other session are notified. If a session previously was not connected (online == FALSE) no entry (services) was selected. We should not derefency a NULL pointer in this case. Fixes BMC#22880
2011-09-19session: Only disconnect online sevicesDaniel Wagner1-2/+5
Fixes BMC#22827
2011-09-19session: Only select new service if not in progressDaniel Wagner1-6/+6
2011-09-19session: Refactor select_and_connect()Daniel Wagner1-31/+42
Make this function more readable.
2011-08-23session: Defer connect/disconnect callsDaniel Wagner1-11/+28
When we call connect and disconnect a service we might reenter the session state machine. So we should defer these calls and finishing up the state change first.
2011-08-23session: Update reason code on disconnectDaniel Wagner1-5/+9
2011-08-23session: reason2string return a string for unknownDaniel Wagner1-1/+1
2011-08-23session: Fix selection of servicesDaniel Wagner1-9/+14
In case we didn't select a service (entry) reset the one in the info (deselection). And then we have also take a refence if the reason was CONNECT.
2011-08-23session: Don't change ref count if reason code is set.Daniel Wagner1-0/+5
If the reason code has been set the proper action has been executed already.
2011-08-23session: Handle service trigger according the reason code.Daniel Wagner1-27/+27
Instead of trying to figure out what we are supposed to do we just rely on the reason code.
2011-08-23session: Don't reset session if serivce was not selectedDaniel Wagner1-1/+2
2011-08-23session: Update service state in all sessionsDaniel Wagner1-5/+14
2011-08-23session: Initialize service hash correctlyDaniel Wagner1-1/+1
2011-08-11session: Allways allow set session modeDaniel Wagner1-3/+0
If the unit test framework crashes it can happen that the session mode is still enabled but we have a connected service. So if the unit test restarted we wont disconnect all services and therefore block for ever. Since it is safe to call __connman_service_disconnect_all() again there is no need to disallow this operation.
2011-08-11session: Fix empty service nameDaniel Wagner1-1/+4
(gdb) bt #0 __strlen_sse2 () at ../sysdeps/x86_64/strlen.S:32 #1 0x0000003a5ee2810b in marshal_string (pos_after=0x7fffffffdd80, byte_order=108, value=0x0, insert_at=20, str=0x6bcc50) at dbus-marshal-basic.c:778 #2 _dbus_marshal_write_basic (str=0x6bcc50, insert_at=20, type=<optimized out>, value=<optimized out>, byte_order=108, pos_after=0x7fffffffdd80) at dbus-marshal-basic.c:858 #3 0x0000003a5ee15f29 in _dbus_type_writer_write_basic_no_typecode (value=<optimized out>, type=115, writer=0x7fffffffdd60) at dbus-marshal-recursive.c:1589 #4 _dbus_type_writer_write_basic_no_typecode (value=<optimized out>, type=115, writer= 0x7fffffffdd60) at dbus-marshal-recursive.c:2736 #5 _dbus_type_writer_write_basic (writer=0x7fffffffdd60, type=115, value=<optimized out>) at dbus-marshal-recursive.c:2311 #6 0x0000003a5ee19c1a in dbus_message_iter_append_basic (value=0x7fffffffde58, type=115, iter= 0x7fffffffdd50) at dbus-message.c:2563 #7 dbus_message_iter_append_basic (iter=0x7fffffffdd50, type=115, value=0x7fffffffde58) at dbus-message.c:2506 #8 0x00000000004597ed in connman_dbus_property_append_basic (iter=0x7fffffffddd0, key= 0x479539 "Name", type=115, val=0x7fffffffde58) at src/dbus.c:123 #9 0x000000000045e11b in connman_dbus_dict_append_basic (dict=0x7fffffffdea0, key= 0x479539 "Name", type=115, val=0x7fffffffde58) at ./include/connman/dbus.h:112 #10 0x000000000045e8ab in append_notify (dict=0x7fffffffdea0, session=0x6d4580) at src/session.c:375 #11 0x000000000045ecf6 in session_notify (user_data=0x6d4580) at src/session.c:498 #12 0x000000000045f885 in session_changed (session=0x6d4580, trigger= CONNMAN_SESSION_TRIGGER_SERVICE) at src/session.c:954 #13 0x0000000000460f66 in service_add (service=0x6b4880, name=0x0) at src/session.c:1602 #14 0x0000000000447946 in __connman_notifier_service_add (service=0x6b4880, name=0x0) at src/notifier.c:413 #15 0x0000000000442fa1 in __connman_service_create_from_network (network=0x6b4af0) at src/service.c:4921 #16 0x00000000004332e4 in network_probe (network=0x6b4af0) at src/network.c:167 #17 0x0000000000433d32 in connman_network_set_group (network=0x6b4af0, group= 0x699ae0 "hidden_managed_psk") at src/network.c:544 #18 0x000000000041c4a5 in network_added (supplicant_network=0x69cab0) at plugins/wifi.c:856 #19 0x000000000041d39c in callback_network_added (network=0x69cab0) at gsupplicant/supplicant.c:396 #20 0x000000000041e878 in add_bss_to_network (bss=0x6a68c0) at gsupplicant/supplicant.c:1023 #21 0x000000000041efa1 in bss_property (key=0x0, iter=0x0, user_data=0x6a68c0) at gsupplicant/supplicant.c:1205 #22 0x000000000041f5f9 in interface_bss_added_with_keys (iter=0x7fffffffe300, user_data= 0x6a70a0) at gsupplicant/supplicant.c:1354 #23 0x0000000000420689 in signal_bss_added (path= 0x6b7818 "/fi/w1/wpa_supplicant1/Interfaces/39", iter=0x7fffffffe300) at gsupplicant/supplicant.c:1783 #24 0x0000000000420cf9 in g_supplicant_filter (conn=0x699770, message=0x6a6b20, data=0x0) at gsupplicant/supplicant.c:1998 #25 0x0000003a5ee0f926 in dbus_connection_dispatch (connection=0x699770) at dbus-connection.c:4647 #26 0x000000000040c4ab in message_dispatch (data=0x699770) at gdbus/mainloop.c:80 #27 0x0000003edf64410b in g_timeout_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at gmain.c:3895 #28 0x0000003edf6427ed in g_main_dispatch (context=0x698100) at gmain.c:2441 #29 g_main_context_dispatch (context=0x698100) at gmain.c:3014 #30 0x0000003edf642fc8 in g_main_context_iterate (context=0x698100, block=<optimized out>, dispatch=1, self=<optimized out>) at gmain.c:3092 #31 0x0000003edf64360d in g_main_loop_run (loop=0x6980c0) at gmain.c:3300 #32 0x000000000042eab6 in main (argc=1, argv=0x7fffffffe6b8) at src/main.c:381 (gdb) f 10 #10 0x000000000045e8ab in append_notify (dict=0x7fffffffdea0, session=0x6d4580) at src/session.c:375 375 connman_dbus_dict_append_basic(dict, "Name", (gdb) l 370 ifname = info->entry->ifname; 371 service = info->entry->service; 372 bearer = info->entry->bearer; 373 } 374 375 connman_dbus_dict_append_basic(dict, "Name", 376 DBUS_TYPE_STRING, 377 &name); 378 379 connman_dbus_dict_append_dict(dict, "IPv4",
2011-08-11session: Free ifnameDaniel Wagner1-2/+4
connman_inet_ifname() returns strdup() string.
2011-08-11session: Insert service_entry into service_listDaniel Wagner1-1/+7
When an element is removed from the list, the element will be passed to destroy_service_entry() which expects only elements of type struct service_entry.
2011-08-11notify: Add service name parameter to service_add()Daniel Wagner1-1/+2
2011-08-11session: Fix invalid session_hash in cleanup pathDaniel Wagner1-0/+1
2011-08-11session: Service changed cleanupDaniel Wagner1-0/+9
2011-08-11session: Track reason on a session levelDaniel Wagner1-0/+18
We need to track the Connect()/Disconnect() on a global session level and not only in the info. This is needed when we were not able to select and connect to a matching service in the first place. It might happen that a valid service is added in time and then we want to use it.
2011-08-11session: Disconnect on destroy if neededDaniel Wagner1-0/+2
2011-08-11session: Move codeDaniel Wagner1-59/+59
release_session(), session_disconnect(), owner_disconnect() and destroy_session() have been moved below session_changed. This is a preperation step for the next patch
2011-08-11session: Split test_and_disconnect()Daniel Wagner1-14/+29
Do split the testing into its own function and also reset the entry member back before we call __connman_service_disconnect(). This is necessary because calling __connman_serivice_disconnect() we can end up beeing called session_changed() before we have updated the entry.
2011-08-11session: Change is_connected to is_onlineDaniel Wagner1-5/+5
2011-08-11session: Handle configure stateDaniel Wagner1-0/+24
We should ignore service state (ASSOCIATION, CONFIGURATION) updates for connecting services (CONNMAN_SESSION_REASON_CONNECT). info->online will still be false for those services. So don't set the info->reason CONNMAN_SESSION_REASAON_FREE_RIDE.
2011-07-06session: Service type to bearer string conversion supportPatrik Flykt1-1/+4
2011-07-06session: Correct GSequence sorting to use service_entry structsPatrik Flykt1-3/+4
The items on session->service_list GSequence are of type service_entry. Fix sorting function to cast the items correctly.
2011-06-16element: Remove element.cDaniel Wagner1-0/+2
2011-05-13session: Fix error path __connman_session_creat()Daniel Wagner1-0/+1
Don't free the session if it exists already.
2011-05-13session: Fix RoamingPolicy parsingDaniel Wagner1-1/+1
If the session has an invalid roaming policy and appending a NULL to the D-Bus message leads to a crash.