MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sbappendstream_locked

Function sbappendstream_locked

freebsd/kern/uipc_sockbuf.c:956–991  ·  view source on GitHub ↗

* This version of sbappend() should only be used when the caller absolutely * knows that there will never be more than one record in the socket buffer, * that is, a stream protocol (such as TCP). */

Source from the content-addressed store, hash-verified

954 * that is, a stream protocol (such as TCP).
955 */
956void
957sbappendstream_locked(struct sockbuf *sb, struct mbuf *m, int flags)
958{
959 SOCKBUF_LOCK_ASSERT(sb);
960
961 KASSERT(m->m_nextpkt == NULL,("sbappendstream 0"));
962
963#ifdef KERN_TLS
964 /*
965 * Decrypted TLS records are appended as records via
966 * sbappendrecord(). TCP passes encrypted TLS records to this
967 * function which must be scheduled for decryption.
968 */
969 if (sb->sb_flags & SB_TLS_RX) {
970 sbappend_ktls_rx(sb, m);
971 return;
972 }
973#endif
974
975 KASSERT(sb->sb_mb == sb->sb_lastrecord,("sbappendstream 1"));
976
977 SBLASTMBUFCHK(sb);
978
979#ifdef KERN_TLS
980 if (sb->sb_tls_info != NULL)
981 ktls_seq(sb, m);
982#endif
983
984 /* Remove all packet headers and mbuf tags to get a pure data chain. */
985 m_demote(m, 1, flags & PRUS_NOTREADY ? M_NOTREADY : 0);
986
987 sbcompress(sb, m, sb->sb_mbtail);
988
989 sb->sb_lastrecord = sb->sb_mb;
990 SBLASTRECORDCHK(sb);
991}
992
993/*
994 * This version of sbappend() should only be used when the caller absolutely

Callers 8

tcp_do_segmentFunction · 0.85
tcp_reassFunction · 0.85
tcp_usr_sendFunction · 0.85
rack_process_dataFunction · 0.85
rack_do_fastnewdataFunction · 0.85
bbr_process_dataFunction · 0.85
bbr_do_fastnewdataFunction · 0.85
sbappendstreamFunction · 0.85

Calls 4

sbappend_ktls_rxFunction · 0.85
ktls_seqFunction · 0.85
m_demoteFunction · 0.85
sbcompressFunction · 0.85

Tested by

no test coverage detected