Lines Matching refs:tcpInfo
463 …if (n->tcpInfo.sock) { mDNSPlatformTCPCloseConnection(n->tcpInfo.sock); n->tcpInfo.sock = mDNSNULL… in RecreateNATMappings()
596 mDNSPlatformMemZero(&traversal->tcpInfo, sizeof(traversal->tcpInfo)); in mDNS_StartNATOperation_internal()
966 tcpInfo_t *tcpInfo = (tcpInfo_t *)context; in tcpCallback() local
968 mDNS *m = tcpInfo->m; in tcpCallback()
969 DNSQuestion *const q = tcpInfo->question; in tcpCallback()
972 tcpInfo->rr ? &tcpInfo->rr ->tcp : mDNSNULL; in tcpCallback()
973 if (backpointer && *backpointer != tcpInfo) in tcpCallback()
975 mDNSPlatformTCPGetFD(tcpInfo->sock), *backpointer, tcpInfo, q, tcpInfo->rr); in tcpCallback()
981 mDNSu8 *end = ((mDNSu8*) &tcpInfo->request) + tcpInfo->requestLen; in tcpCallback()
986 if (tcpInfo->rr && tcpInfo->rr->resrec.name != &tcpInfo->rr->namestorage) in tcpCallback()
988 tcpInfo->rr->resrec.name, &tcpInfo->rr->namestorage); in tcpCallback()
989 if (tcpInfo->rr && tcpInfo->rr-> resrec.name != &tcpInfo->rr-> namestorage) return; in tcpCallback()
991 AuthInfo = tcpInfo->rr ? GetAuthInfoForName(m, tcpInfo->rr->resrec.name) : mDNSNULL; in tcpCallback()
997 end = ((mDNSu8*) &tcpInfo->request) + tcpInfo->requestLen; in tcpCallback()
1008 …llqData.err = GetLLQEventPort(m, &tcpInfo->Addr); // We're using TCP; tell server what UDP port … in tcpCallback()
1012 InitializeDNSMessage(&tcpInfo->request.h, q->TargetQID, uQueryFlags); in tcpCallback()
1013 end = putLLQ(&tcpInfo->request, tcpInfo->request.data, q, &llqData); in tcpCallback()
1021 InitializeDNSMessage(&tcpInfo->request.h, q->TargetQID, uQueryFlags); in tcpCallback()
1022 …end = putQuestion(&tcpInfo->request, tcpInfo->request.data, tcpInfo->request.data + AbsoluteMaxDNS… in tcpCallback()
1026 …err = mDNSSendDNSMessage(m, &tcpInfo->request, end, mDNSInterface_Any, mDNSNULL, &tcpInfo->Addr, t… in tcpCallback()
1043 if (tcpInfo->nread < 2) // First read the two-byte length preceeding the DNS message in tcpCallback()
1045 mDNSu8 *lenptr = (mDNSu8 *)&tcpInfo->replylen; in tcpCallback()
1046 n = mDNSPlatformReadTCP(sock, lenptr + tcpInfo->nread, 2 - tcpInfo->nread, &closed); in tcpCallback()
1059 if (tcpInfo->numReplies == 0) in tcpCallback()
1061 LogMsg("ERROR: socket closed prematurely tcpInfo->nread = %d", tcpInfo->nread); in tcpCallback()
1071 DisposeTCPConn(tcpInfo); in tcpCallback()
1076 tcpInfo->nread += n; in tcpCallback()
1077 if (tcpInfo->nread < 2) goto exit; in tcpCallback()
1079 tcpInfo->replylen = (mDNSu16)((mDNSu16)lenptr[0] << 8 | lenptr[1]); in tcpCallback()
1080 if (tcpInfo->replylen < sizeof(DNSMessageHeader)) in tcpCallback()
1081 …{ LogMsg("ERROR: tcpCallback - length too short (%d bytes)", tcpInfo->replylen); err = mStatus_Unk… in tcpCallback()
1083 tcpInfo->reply = mDNSPlatformMemAllocate(tcpInfo->replylen); in tcpCallback()
1084 …if (!tcpInfo->reply) { LogMsg("ERROR: tcpCallback - malloc failed"); err = mStatus_NoMemoryErr; go… in tcpCallback()
1087 …n = mDNSPlatformReadTCP(sock, ((char *)tcpInfo->reply) + (tcpInfo->nread - 2), tcpInfo->replylen -… in tcpCallback()
1097 if (tcpInfo->numReplies == 0) in tcpCallback()
1099 LogMsg("ERROR: socket closed prematurely tcpInfo->nread = %d", tcpInfo->nread); in tcpCallback()
1109 DisposeTCPConn(tcpInfo); in tcpCallback()
1114 tcpInfo->nread += n; in tcpCallback()
1116 if ((tcpInfo->nread - 2) == tcpInfo->replylen) in tcpCallback()
1119 DNSMessage *reply = tcpInfo->reply; in tcpCallback()
1120 mDNSu8 *end = (mDNSu8 *)tcpInfo->reply + tcpInfo->replylen; in tcpCallback()
1121 mDNSAddr Addr = tcpInfo->Addr; in tcpCallback()
1122 mDNSIPPort Port = tcpInfo->Port; in tcpCallback()
1124 tcpInfo->numReplies++; in tcpCallback()
1125 …tcpInfo->reply = mDNSNULL; // Detach reply buffer from tcpInfo_t, to make sure client callback … in tcpCallback()
1126 tcpInfo->nread = 0; in tcpCallback()
1127 tcpInfo->replylen = 0; in tcpCallback()
1143 { *backpointer = mDNSNULL; DisposeTCPConn(tcpInfo); } in tcpCallback()
1225 DisposeTCPConn(tcpInfo); in tcpCallback()