Fix bug and RTT abbr

This commit is contained in:
Quentin 2019-05-14 14:48:40 +02:00
parent bc3ac8e9db
commit 10cde520c9
2 changed files with 2 additions and 2 deletions

View file

@ -23,7 +23,7 @@ Now your machine is ready and you will be able to use the following commads:
* `donar` is our main binary. It can be run as a client or a server. * `donar` is our main binary. It can be run as a client or a server.
* `udpecho` is a simple udp server that send back the data sent to him. * `udpecho` is a simple udp server that send back the data sent to him.
* `torecho` is a simple tcp server that send back the data sent to him + configure the tor daemon to generate a hidden service URL and be accessible on the Tor network. * `torecho` is a simple tcp server that send back the data sent to him + configure the tor daemon to generate a hidden service URL and be accessible on the Tor network.
* `measlat` can be used in conjunction with `udpecho` or `torecho` to measure a Rount Time Trip (RTT) * `measlat` can be used in conjunction with `udpecho` or `torecho` to measure a Round Trip Time (RTT)
Try to run the previous commands in your terminal without any option, you will see their help. Try to run the previous commands in your terminal without any option, you will see their help.

View file

@ -56,7 +56,7 @@ enum FD_STATE write_packet_to_tcp(int fd, struct buffer_packet* bp) {
enum FD_STATE write_packet_to_udp(int fd, struct buffer_packet* bp, struct udp_target* udp_t) { enum FD_STATE write_packet_to_udp(int fd, struct buffer_packet* bp, struct udp_target* udp_t) {
ssize_t nwrite; ssize_t nwrite;
size_t bytes_to_send; size_t bytes_to_send;
assert(bp->ip.ap.headers.cmd == CMD_CLEAR); assert(bp->ip.ap.fmt.headers.cmd == CMD_CLEAR);
size_t pkt_header_size = sizeof(bp->ip.ap.fmt.headers) + sizeof(bp->ip.ap.fmt.content.clear) - sizeof(char); size_t pkt_header_size = sizeof(bp->ip.ap.fmt.headers) + sizeof(bp->ip.ap.fmt.content.clear) - sizeof(char);
struct sockaddr* addr = NULL; struct sockaddr* addr = NULL;
socklen_t addrlen = 0; socklen_t addrlen = 0;