Changeset e81168e085d99077d2eb610f736362d07f4cd7a0
- Timestamp:
- 01/06/07 23:56:58 (6 years ago)
- Author:
- Philipp Kern <phil@…>
- Parents:
- 882c70800a8013d9e53928091ef8e445f5938708
- Children:
- 8c777f1302af5966dc645563524507bfb5b9baae
- git-committer:
- Philipp Kern <phil@0x539.de> / 2007-01-06T22:56:58Z+0000
- Message:
-
[project @ Experimental patch for client-initiated encryption]
Original author: Philipp Kern <phil@…>
Date: 2006-02-14 20:53:46+00:00
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r882c708
|
re81168e
|
|
| 42 | 42 | void add(const net6::socket& sock, net6::io_condition cond); |
| 43 | 43 | void remove(const net6::socket& sock, net6::io_condition cond); |
| | 44 | void set(const net6::socket& sock, net6::io_condition cond); |
| 44 | 45 | net6::io_condition check(const net6::socket& sock, |
| 45 | 46 | net6::io_condition mask) const; |
-
|
r882c708
|
re81168e
|
|
| 107 | 107 | // Obby signal handlers |
| 108 | 108 | void on_obby_close(); |
| | 109 | void on_obby_encrypted(); |
| 109 | 110 | |
| 110 | 111 | void on_obby_user_join(const obby::user& user); |
-
|
r882c708
|
re81168e
|
|
| 134 | 134 | } |
| 135 | 135 | |
| | 136 | void Gobby::GSelector::set(const net6::socket& sock, net6::io_condition cond) |
| | 137 | { |
| | 138 | // TODO: Port add and remove to set |
| | 139 | map_type::iterator iter = m_map.find(&sock); |
| | 140 | if(cond == net6::IO_NONE && iter == m_map.end() ) |
| | 141 | return; |
| | 142 | else if(cond == net6::IO_NONE) |
| | 143 | remove(sock, ~cond); |
| | 144 | else if(iter == m_map.end() ) |
| | 145 | add(sock, cond); |
| | 146 | else |
| | 147 | { |
| | 148 | remove(sock, ~cond); |
| | 149 | add(sock, cond); |
| | 150 | } |
| | 151 | } |
| | 152 | |
| 136 | 153 | net6::io_condition Gobby::GSelector::check(const net6::socket& sock, |
| 137 | 154 | net6::io_condition mask) const |
-
|
r882c708
|
re81168e
|
|
| 430 | 430 | buffer->close_event().connect( |
| 431 | 431 | sigc::mem_fun(*this, &Window::on_obby_close) ); |
| | 432 | buffer->encrypted_event().connect( |
| | 433 | sigc::mem_fun(*this, &Window::on_obby_encrypted) ); |
| | 434 | |
| | 435 | buffer->request_encryption(); |
| 432 | 436 | |
| 433 | 437 | obby::format_string str(_("Connected to %0%:%1%") ); |
| … |
… |
|
| 915 | 919 | } |
| 916 | 920 | |
| | 921 | void Gobby::Window::on_obby_encrypted() |
| | 922 | { |
| | 923 | display_error("Connection now encrypted"); |
| | 924 | } |
| | 925 | |
| 917 | 926 | void Gobby::Window::on_obby_user_join(const obby::user& user) |
| 918 | 927 | { |
| … |
… |
|
| 1177 | 1186 | dlg.run(); |
| 1178 | 1187 | } |
| | 1188 | |