Changeset e81168e085d99077d2eb610f736362d07f4cd7a0

Show
Ignore:
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:
4 modified

Legend:

Unmodified
Added
Removed
  • inc/gselector.hpp

    r882c708 re81168e  
    4242        void add(const net6::socket& sock, net6::io_condition cond); 
    4343        void remove(const net6::socket& sock, net6::io_condition cond); 
     44        void set(const net6::socket& sock, net6::io_condition cond); 
    4445        net6::io_condition check(const net6::socket& sock, 
    4546                                 net6::io_condition mask) const; 
  • inc/window.hpp

    r882c708 re81168e  
    107107        // Obby signal handlers 
    108108        void on_obby_close(); 
     109        void on_obby_encrypted(); 
    109110 
    110111        void on_obby_user_join(const obby::user& user); 
  • src/gselector.cpp

    r882c708 re81168e  
    134134} 
    135135 
     136void 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 
    136153net6::io_condition Gobby::GSelector::check(const net6::socket& sock, 
    137154                                           net6::io_condition mask) const 
  • src/window.cpp

    r882c708 re81168e  
    430430                        buffer->close_event().connect( 
    431431                                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(); 
    432436 
    433437                        obby::format_string str(_("Connected to %0%:%1%") ); 
     
    915919} 
    916920 
     921void Gobby::Window::on_obby_encrypted() 
     922{ 
     923        display_error("Connection now encrypted"); 
     924} 
     925 
    917926void Gobby::Window::on_obby_user_join(const obby::user& user) 
    918927{ 
     
    11771186        dlg.run(); 
    11781187} 
     1188