From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 660825A026F; Tue, 21 Jan 2025 00:49:58 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH] tcp: Set PSH flag for last incoming packets in a batch Date: Tue, 21 Jan 2025 00:49:58 +0100 Message-ID: <20250120234958.3247370-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Message-ID-Hash: 2FIRAB2HO7JHT6NWRGFUOVJVMKG5NRXA X-Message-ID-Hash: 2FIRAB2HO7JHT6NWRGFUOVJVMKG5NRXA X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: U28gZmFyIHdlIG9taXR0ZWQgc2V0dGluZyBQU0ggZmxhZ3MgZm9yIGluYm91bmQgdHJhZmZpYyBh bHRvZ2V0aGVyOiBhcw0Kd2UgaWdub3JlIHRoZSBuYXR1cmUgb2YgdGhlIGRhdGEgd2UncmUgc2Vu ZGluZywgd2UgY2FuJ3QgY29uY2x1ZGUgdGhhdA0Kc29tZSBkYXRhIGlzIG1vcmUgb3IgbGVzcyB1 cmdlbnQuIFRoaXMgd29ya3MgZmluZSB3aXRoIExpbnV4IGd1ZXN0cywNCmFzIHRoZSBMaW51eCBr ZXJuZWwgZG9lc24ndCBkbyBtdWNoIHdpdGggaXQsIG9uIGlucHV0OiBpdCB3aWxsDQpnZW5lcmFs bHkgZGVsaXZlciBkYXRhIHRvIHRoZSBhcHBsaWNhdGlvbiBsYXllciB3aXRob3V0IGRlbGF5Lg0K DQpIb3dldmVyL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