| 79 Bool opening, IcePointer *watch_data) { |
79 Bool opening, IcePointer *watch_data) { |
| 80 struct ice_connection_info *conninfo = NULL; |
80 struct ice_connection_info *conninfo = NULL; |
| 81 |
81 |
| 82 if (opening) { |
82 if (opening) { |
| 83 purple_debug(PURPLE_DEBUG_INFO, "Session Management", |
83 purple_debug(PURPLE_DEBUG_INFO, "Session Management", |
| 84 "Handling new ICE connection... "); |
84 "Handling new ICE connection... \n"); |
| 85 |
85 |
| 86 /* ensure ICE connection is not passed to child processes */ |
86 /* ensure ICE connection is not passed to child processes */ |
| 87 fcntl(IceConnectionNumber(connection), F_SETFD, FD_CLOEXEC); |
87 fcntl(IceConnectionNumber(connection), F_SETFD, FD_CLOEXEC); |
| 88 |
88 |
| 89 conninfo = g_new(struct ice_connection_info, 1); |
89 conninfo = g_new(struct ice_connection_info, 1); |
| 93 conninfo->input_id = purple_input_add(IceConnectionNumber(connection), PURPLE_INPUT_READ, |
93 conninfo->input_id = purple_input_add(IceConnectionNumber(connection), PURPLE_INPUT_READ, |
| 94 ice_process_messages, conninfo); |
94 ice_process_messages, conninfo); |
| 95 *watch_data = conninfo; |
95 *watch_data = conninfo; |
| 96 } else { |
96 } else { |
| 97 purple_debug(PURPLE_DEBUG_INFO, "Session Management", |
97 purple_debug(PURPLE_DEBUG_INFO, "Session Management", |
| 98 "Handling closed ICE connection... "); |
98 "Handling closed ICE connection... \n"); |
| 99 |
99 |
| 100 /* get the input ID back and stop watching it */ |
100 /* get the input ID back and stop watching it */ |
| 101 conninfo = (struct ice_connection_info*) *watch_data; |
101 conninfo = (struct ice_connection_info*) *watch_data; |
| 102 purple_input_remove(conninfo->input_id); |
102 purple_input_remove(conninfo->input_id); |
| 103 g_free(conninfo); |
103 g_free(conninfo); |