Skip to content

Commit

Permalink
Merge pull request #259 from flaviojs/fix-packet-size-netio_tcp
Browse files Browse the repository at this point in the history
Fix packet size of netio_tcp_send/netio_tcp_recv.
  • Loading branch information
grossmj authored Oct 5, 2024
2 parents 113fdc5 + 9b4ae40 commit d0bc918
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/net_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ static void netio_tcp_free(netio_inet_desc_t *nid)
*/
static ssize_t netio_tcp_send(netio_inet_desc_t *nid,void *pkt,size_t pkt_len)
{
u_long l = htonl(pkt_len);
m_uint32_t l = htonl(pkt_len);

if (write(nid->fd,&l,sizeof(l)) == -1)
return(-1);
Expand All @@ -731,7 +731,7 @@ static ssize_t netio_tcp_send(netio_inet_desc_t *nid,void *pkt,size_t pkt_len)

static ssize_t netio_tcp_recv(netio_inet_desc_t *nid,void *pkt,size_t max_len)
{
u_long l;
m_uint32_t l;

if (read(nid->fd,&l,sizeof(l)) != sizeof(l))
return(-1);
Expand Down

0 comments on commit d0bc918

Please sign in to comment.