did stuff
This commit is contained in:
parent
541f667a0e
commit
08e67936c5
1 changed files with 5 additions and 7 deletions
|
|
@ -158,17 +158,13 @@ impl SocketImpl {
|
||||||
let mut response_packet = packet.base_response_packet();
|
let mut response_packet = packet.base_response_packet();
|
||||||
|
|
||||||
response_packet.header.types_and_flags.set_types(SYN);
|
response_packet.header.types_and_flags.set_types(SYN);
|
||||||
response_packet.header.types_and_flags.set_flag(flags::ACK);
|
response_packet.header.types_and_flags.set_flag(ACK);
|
||||||
response_packet.header.types_and_flags.set_flag(flags::HAS_SIZE);
|
response_packet.header.types_and_flags.set_flag(HAS_SIZE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
conn.signature = connection.calculate_connection_signature();
|
conn.signature = connection.calculate_connection_signature();
|
||||||
|
|
||||||
response_packet.options.push(ConnectionSignature(conn.signature));
|
response_packet.options.push(ConnectionSignature(conn.signature));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for options in &packet.options{
|
for options in &packet.options{
|
||||||
match options{
|
match options{
|
||||||
SupportedFunctions(functions) => {
|
SupportedFunctions(functions) => {
|
||||||
|
|
@ -203,7 +199,7 @@ impl SocketImpl {
|
||||||
response_packet.header.session_id = conn.session_id;
|
response_packet.header.session_id = conn.session_id;
|
||||||
response_packet.header.sequence_id = 1;
|
response_packet.header.sequence_id = 1;
|
||||||
|
|
||||||
response_packet.options.push(ConnectionSignature(conn.signature));
|
response_packet.options.push(ConnectionSignature(Default::default()));
|
||||||
|
|
||||||
for option in &packet.options{
|
for option in &packet.options{
|
||||||
match option {
|
match option {
|
||||||
|
|
@ -228,6 +224,8 @@ impl SocketImpl {
|
||||||
response_packet.write_to(&mut vec).expect("somehow failed to convert backet to bytes");
|
response_packet.write_to(&mut vec).expect("somehow failed to convert backet to bytes");
|
||||||
|
|
||||||
self.socket.send_to(&vec, connection.regular_socket_addr).await.expect("failed to send data back");
|
self.socket.send_to(&vec, connection.regular_socket_addr).await.expect("failed to send data back");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
_ => unimplemented!("unimplemented packet type: {}", packet.header.types_and_flags.get_types())
|
_ => unimplemented!("unimplemented packet type: {}", packet.header.types_and_flags.get_types())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue