Re: Windows sockets (select missing events?) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Windows sockets (select missing events?)
Date
Msg-id CAEudQArx03C3x2UDKjTrknFsxYmx3Bu+A6yyi59y1NRFi2s3xQ@mail.gmail.com
Whole thread Raw
In response to Windows sockets (select missing events?)  (Ranier Vilela <ranier.vf@gmail.com>)
Responses Re: Windows sockets (select missing events?)
List pgsql-hackers
Em qui., 28 de dez. de 2023 às 14:45, Ranier Vilela <ranier.vf@gmail.com> escreveu:
Hi,

The type of field fd_count is defined in winsock.h:
typedef unsigned int    u_int;

So in the struct fd_set,
the field fd_count is unsigned int.

The pgwin32_select  function has loops that use *int* as indices.

Question: in Windows, the socket select function isn't missing some events?
 
If not, It would be a good prevention practice, using the correct type, right?

Patch attached.
Fix overflow with patch.

best regards,
Ranier Vilela
Attachment

pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Fix resource leak (src/bin/pg_combinebackup/pg_combinebackup.c)
Next
From: Pavel Luzanov
Date:
Subject: Re: Things I don't like about \du's "Attributes" column