1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-28 20:44:26 +01:00

Refactored code related to stream/flow initialization. (#170)

- Removed client_flow().process_packet() in Stream constructor, in favor of processing on SYN in stream follower.
- Moved +1 to seq on SYN/ACK.
This commit is contained in:
Patrick Michel
2016-09-28 16:30:16 +02:00
committed by Matias Fontanini
parent e82b72e931
commit 838a4a5cb9
4 changed files with 35 additions and 39 deletions

View File

@@ -140,7 +140,6 @@ void Flow::update_state(const TCP& tcp) {
ack_tracker_ = AckTracker(tcp.ack_seq());
#endif // TINS_HAVE_ACK_TRACKER
state_ = ESTABLISHED;
data_tracker_.sequence_number(data_tracker_.sequence_number() + 1);
}
else if (state_ == UNKNOWN && (tcp.flags() & TCP::SYN) != 0) {
// This is the server's state, sending it's first SYN|ACK
@@ -148,7 +147,7 @@ void Flow::update_state(const TCP& tcp) {
ack_tracker_ = AckTracker(tcp.ack_seq());
#endif // TINS_HAVE_ACK_TRACKER
state_ = SYN_SENT;
data_tracker_.sequence_number(tcp.seq());
data_tracker_.sequence_number(tcp.seq() + 1);
const TCP::option* mss_option = tcp.search_option(TCP::MSS);
if (mss_option) {
mss_ = mss_option->to<uint16_t>();