@@ -656,7 +656,7 @@ void CNode::copyStats(CNodeStats &stats) {
656656 stats.m_conn_type_string = ConnectionTypeAsString ();
657657}
658658
659- bool CNode::ReceiveMsgBytes (const Config &config, Span<const char > msg_bytes,
659+ bool CNode::ReceiveMsgBytes (const Config &config, Span<const uint8_t > msg_bytes,
660660 bool &complete) {
661661 complete = false ;
662662 const auto time = GetTime<std::chrono::microseconds>();
@@ -696,7 +696,7 @@ bool CNode::ReceiveMsgBytes(const Config &config, Span<const char> msg_bytes,
696696}
697697
698698int V1TransportDeserializer::readHeader (const Config &config,
699- Span<const char > msg_bytes) {
699+ Span<const uint8_t > msg_bytes) {
700700 // copy data to temporary parsing buffer
701701 uint32_t nRemaining = CMessageHeader::HEADER_SIZE - nHdrPos;
702702 uint32_t nCopy = std::min<unsigned int >(nRemaining, msg_bytes.size ());
@@ -728,7 +728,7 @@ int V1TransportDeserializer::readHeader(const Config &config,
728728 return nCopy;
729729}
730730
731- int V1TransportDeserializer::readData (Span<const char > msg_bytes) {
731+ int V1TransportDeserializer::readData (Span<const uint8_t > msg_bytes) {
732732 unsigned int nRemaining = hdr.nMessageSize - nDataPos;
733733 unsigned int nCopy = std::min<unsigned int >(nRemaining, msg_bytes.size ());
734734
@@ -738,7 +738,7 @@ int V1TransportDeserializer::readData(Span<const char> msg_bytes) {
738738 vRecv.resize (std::min (hdr.nMessageSize , nDataPos + nCopy + 256 * 1024 ));
739739 }
740740
741- hasher.Write (MakeUCharSpan ( msg_bytes.first (nCopy) ));
741+ hasher.Write (msg_bytes.first (nCopy));
742742 memcpy (&vRecv[nDataPos], msg_bytes.data (), nCopy);
743743 nDataPos += nCopy;
744744
@@ -1819,20 +1819,20 @@ void CConnman::SocketHandler() {
18191819 }
18201820 if (recvSet || errorSet) {
18211821 // typical socket buffer is 8K-64K
1822- char pchBuf[0x10000 ];
1822+ uint8_t pchBuf[0x10000 ];
18231823 int32_t nBytes = 0 ;
18241824 {
18251825 LOCK (pnode->cs_hSocket );
18261826 if (pnode->hSocket == INVALID_SOCKET) {
18271827 continue ;
18281828 }
1829- nBytes =
1830- recv (pnode-> hSocket , pchBuf, sizeof (pchBuf), MSG_DONTWAIT);
1829+ nBytes = recv (pnode-> hSocket , ( char *)pchBuf, sizeof (pchBuf),
1830+ MSG_DONTWAIT);
18311831 }
18321832 if (nBytes > 0 ) {
18331833 bool notify = false ;
18341834 if (!pnode->ReceiveMsgBytes (
1835- *config, Span<const char >(pchBuf, nBytes), notify)) {
1835+ *config, Span<const uint8_t >(pchBuf, nBytes), notify)) {
18361836 pnode->CloseSocketDisconnect ();
18371837 }
18381838 RecordBytesRecv (nBytes);
0 commit comments