| 4971 | |
| 4972 | #ifdef SCTP_MBCNT_LOGGING |
| 4973 | void |
| 4974 | sctp_free_bufspace(struct sctp_tcb *stcb, struct sctp_association *asoc, |
| 4975 | struct sctp_tmit_chunk *tp1, int chk_cnt) |
| 4976 | { |
| 4977 | if (tp1->data == NULL) { |
| 4978 | return; |
| 4979 | } |
| 4980 | asoc->chunks_on_out_queue -= chk_cnt; |
| 4981 | if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBCNT_LOGGING_ENABLE) { |
| 4982 | sctp_log_mbcnt(SCTP_LOG_MBCNT_DECREASE, |
| 4983 | asoc->total_output_queue_size, |
| 4984 | tp1->book_size, |
| 4985 | 0, |
| 4986 | tp1->mbcnt); |
| 4987 | } |
| 4988 | if (asoc->total_output_queue_size >= tp1->book_size) { |
| 4989 | atomic_add_int(&asoc->total_output_queue_size, -tp1->book_size); |
| 4990 | } else { |
| 4991 | asoc->total_output_queue_size = 0; |
| 4992 | } |
| 4993 | |
| 4994 | if (stcb->sctp_socket && (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) || |
| 4995 | ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)))) { |
| 4996 | if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { |
| 4997 | stcb->sctp_socket->so_snd.sb_cc -= tp1->book_size; |
| 4998 | } else { |
| 4999 | stcb->sctp_socket->so_snd.sb_cc = 0; |
| 5000 | } |
| 5001 | } |
| 5002 | } |
| 5003 | |
| 5004 | #endif |
| 5005 |
no test coverage detected