Lines Matching full:cd

263 	struct cf_conn *cd;
292 cd = mem_alloc(sizeof(*cd));
293 cd->strm_stat = XPRT_IDLE;
299 xprt->xp_p1 = cd;
335 mem_free(cd, sizeof(*cd));
347 struct cf_conn *cd = NULL;
349 cd = mem_alloc(sizeof(*cd));
350 cd->strm_stat = XPRT_IDLE;
356 xprt->xp_p1 = cd;
537 struct cf_conn *cd = (struct cf_conn *)xprt->xp_p1;
553 if (cd->mreq)
554 m_freem(cd->mreq);
555 if (cd->mpending)
556 m_freem(cd->mpending);
557 mem_free(cd, sizeof(*cd));
563 struct cf_conn *cd = (struct cf_conn *)xprt->xp_p1;
567 m = cd->mreq;
573 mem_free(cd, sizeof(*cd));
600 struct cf_conn *cd;
602 cd = (struct cf_conn *)(xprt->xp_p1);
604 if (cd->strm_stat == XPRT_DIED)
607 if (cd->mreq != NULL && cd->resid == 0 && cd->eor)
628 struct cf_conn *cd;
630 cd = (struct cf_conn *)(xprt->xp_p1);
632 if (cd->mreq != NULL)
639 * If we have an mbuf chain in cd->mpending, try to parse a record from it,
640 * leaving the result in cd->mreq. If we don't have a complete record, leave
641 * the partial result in cd->mreq and try to read more from the socket.
646 struct cf_conn *cd = (struct cf_conn *) xprt->xp_p1;
651 * If cd->resid is non-zero, we have part of the
655 if (!cd->resid && cd->mpending) {
665 m = cd->mpending;
674 m_copydata(cd->mpending, 0, sizeof(header),
677 cd->eor = (header & 0x80000000) != 0;
678 cd->resid = header & 0x7fffffff;
679 m_adj(cd->mpending, sizeof(uint32_t));
683 * Start pulling off mbufs from cd->mpending
689 while (cd->mpending && cd->resid) {
690 m = cd->mpending;
691 if (cd->mpending->m_next
692 || cd->mpending->m_len > cd->resid)
693 cd->mpending = m_split(cd->mpending,
694 cd->resid, M_WAITOK);
696 cd->mpending = NULL;
697 if (cd->mreq)
698 m_last(cd->mreq)->m_next = m;
700 cd->mreq = m;
702 cd->resid -= m->m_len;
711 if (cd->mpending)
715 imax(1, imin(cd->resid, so->so_rcv.sb_hiwat / 2));
723 struct cf_conn *cd = (struct cf_conn *) xprt->xp_p1;
742 while (cd->mpending &&
743 (cd->mreq == NULL || cd->resid != 0 || !cd->eor)) {
748 /* Process and return complete request in cd->mreq. */
749 if (cd->mreq != NULL && cd->resid == 0 && cd->eor) {
756 if ((cd->mreq->m_len >= sizeof(xid_plus_direction) ||
757 m_length(cd->mreq, NULL) >=
760 m_copydata(cd->mreq, 0,
770 cd->mreq,
772 cd->mreq = NULL;
777 xdrmbuf_create(&xdrs, cd->mreq, XDR_DECODE);
778 cd->mreq = NULL;
782 if (cd->mreq == NULL || cd->resid != 0) {
820 * the result in cd->mpending. If the read fails,
821 * we have drained both cd->mpending and the socket so
887 cd->strm_stat = XPRT_DIED;
898 cd->strm_stat = XPRT_DIED;
934 if (cd->mpending)
935 m_last(cd->mpending)->m_next = m;
937 cd->mpending = m;
945 struct cf_conn *cd = (struct cf_conn *) xprt->xp_p1;
957 m = cd->mreq;
964 cd->mreq = m->m_nextpkt;