mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-01-19 14:29:34 +08:00
trival
This commit is contained in:
parent
b0c8448fdf
commit
db726b445a
6
main.cpp
6
main.cpp
@ -958,6 +958,7 @@ int keep_connection_client(conn_info_t &conn_info) //for client
|
||||
send_info.syn = 1;
|
||||
send_info.psh = 0;
|
||||
|
||||
|
||||
send_bare(raw_info, 0, 0); /////////////send
|
||||
}
|
||||
else if(raw_mode==mode_udp||raw_mode==mode_icmp)
|
||||
@ -987,6 +988,7 @@ int keep_connection_client(conn_info_t &conn_info) //for client
|
||||
{
|
||||
mylog(log_info,"retry send sync\n");
|
||||
send_info.seq=send_info.first_seq;
|
||||
send_info.ts_ack = 0;
|
||||
send_bare(raw_info,0,0); /////////////send
|
||||
conn_info.last_hb_sent_time=get_current_time();
|
||||
}
|
||||
@ -2366,7 +2368,7 @@ int client_event_loop()
|
||||
read(timer_fd, &value, 8);
|
||||
keep_connection_client(conn_info);
|
||||
|
||||
mylog(log_debug,"epoll_trigger_counter: %d \n",epoll_trigger_counter);
|
||||
mylog(log_trace,"epoll_trigger_counter: %d \n",epoll_trigger_counter);
|
||||
epoll_trigger_counter=0;
|
||||
}
|
||||
else if (events[idx].data.u64 == (uint64_t)udp_fd)
|
||||
@ -2546,7 +2548,7 @@ int server_event_loop()
|
||||
mylog(log_debug,"conn_manager.clear_inactive(),%lld,%lld,%lld \n",begin_time,end_time,end_time-begin_time);
|
||||
}
|
||||
|
||||
mylog(log_debug,"epoll_trigger_counter: %d \n",epoll_trigger_counter);
|
||||
mylog(log_trace,"epoll_trigger_counter: %d \n",epoll_trigger_counter);
|
||||
epoll_trigger_counter=0;
|
||||
|
||||
}
|
||||
|
@ -498,7 +498,7 @@ int send_raw_udp(raw_info_t &raw_info, const char * payload, int payloadlen)
|
||||
mylog(log_debug,"invalid len\n");
|
||||
return -1;
|
||||
}
|
||||
mylog(log_debug,"udp_len:%d %d\n",udp_tot_len,udph->len);
|
||||
mylog(log_trace,"udp_len:%d %d\n",udp_tot_len,udph->len);
|
||||
udph->len=htons(uint16_t(udp_tot_len));
|
||||
|
||||
memcpy(send_raw_udp_buf+sizeof(struct pseudo_header)+sizeof(udphdr),payload,payloadlen);
|
||||
@ -876,7 +876,7 @@ int recv_raw_icmp(raw_info_t &raw_info, char *&payload, int &payloadlen)
|
||||
|
||||
payload=ip_payload+sizeof(icmphdr);
|
||||
payloadlen=ip_payloadlen-sizeof(icmphdr);
|
||||
mylog(log_debug,"get a packet len=%d\n",payloadlen);
|
||||
mylog(log_trace,"get a packet len=%d\n",payloadlen);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user