rust/hedgewars-server/src/server/network.rs
changeset 15531 ede5f4ec48f3
parent 15530 a859f08ebb4f
child 15800 6af892a0a4b8
equal deleted inserted replaced
15530:a859f08ebb4f 15531:ede5f4ec48f3
   469                 TimeoutEvent::DropClient => {
   469                 TimeoutEvent::DropClient => {
   470                     if let Some(ref mut client) = self.clients.get_mut(client_id) {
   470                     if let Some(ref mut client) = self.clients.get_mut(client_id) {
   471                         client.send_string(
   471                         client.send_string(
   472                             &HwServerMessage::Bye("Ping timeout".to_string()).to_raw_protocol(),
   472                             &HwServerMessage::Bye("Ping timeout".to_string()).to_raw_protocol(),
   473                         );
   473                         );
   474                         client.write();
   474                         let _res = client.write();
   475                     }
   475                     }
   476                     self.operation_failed(
   476                     self.operation_failed(
   477                         poll,
   477                         poll,
   478                         client_id,
   478                         client_id,
   479                         &ErrorKind::TimedOut.into(),
   479                         &ErrorKind::TimedOut.into(),
   488     #[cfg(feature = "official-server")]
   488     #[cfg(feature = "official-server")]
   489     pub fn handle_io_result(&mut self, poll: &Poll) -> io::Result<()> {
   489     pub fn handle_io_result(&mut self, poll: &Poll) -> io::Result<()> {
   490         while let Some((client_id, result)) = self.io.try_recv() {
   490         while let Some((client_id, result)) = self.io.try_recv() {
   491             debug!("Handling io result {:?} for client {}", result, client_id);
   491             debug!("Handling io result {:?} for client {}", result, client_id);
   492             let mut response = handlers::Response::new(client_id);
   492             let mut response = handlers::Response::new(client_id);
   493             handlers::handle_io_result(&mut self.server, client_id, &mut response, result);
   493             handlers::handle_io_result(&mut self.server_state, client_id, &mut response, result);
   494             self.handle_response(response, poll);
   494             self.handle_response(response, poll);
   495         }
   495         }
   496         Ok(())
   496         Ok(())
   497     }
   497     }
   498 
   498 
   720             .expect("Cannot find certificate file");
   720             .expect("Cannot find certificate file");
   721         builder
   721         builder
   722             .set_private_key_file("ssl/key.pem", SslFiletype::PEM)
   722             .set_private_key_file("ssl/key.pem", SslFiletype::PEM)
   723             .expect("Cannot find private key file");
   723             .expect("Cannot find private key file");
   724         builder.set_options(SslOptions::NO_COMPRESSION);
   724         builder.set_options(SslOptions::NO_COMPRESSION);
   725         builder.set_options(SslOptions::NO_TLSV1_0);
   725         builder.set_options(SslOptions::NO_TLSV1);
   726         builder.set_options(SslOptions::NO_TLSV1_1);
   726         builder.set_options(SslOptions::NO_TLSV1_1);
   727         builder.set_cipher_list("ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384").unwrap();
   727         builder.set_cipher_list("ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384").unwrap();
   728         ServerSsl {
   728         ServerSsl {
   729             listener,
   729             listener,
   730             context: builder.build(),
   730             context: builder.build(),