20 ms·
This has been a feature upstream in FreeBSD for roughly 6 years. If there is a connection RST, then the data buffered in the kernel is released (either freed i
by drewg123 4y ago
This has been a feature upstream in FreeBSD for roughly 6 years.
If there is a connection RST, then the data buffered in the kernel is released (either freed immediately, or put into the page cache, depending on SF_NOCACHE).
sendfile_iodone() is called for completion. If there is no error, it marks the mbufs on the socket buffer holding the pages that were recently brought in as ready, and pokes the TCP stack to send them. If there was an error, it calls TCP's pru_abort() function to tear down the connection and release what's sitting on the socket buffer. See https://github.com/freebsd/freebsd-src/blob/main/sys/kern/kern_sendfile.c#L289 https://github.com/freebsd/freebsd-src/blob/main/sys/kern/ke...