Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-07

Win32 sockets patch

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ales Katona

There is an ugly type bug in win32 sockets.pp.
This patch fixes it.

ssize_t = cuint16 -- this caused a bug with fprecv/fprecvfrom and fpsend/fpsendto calls because winsock.recv[from]/winsock.send[to] calls return a longint while fprecv used an unsigned int as return value.

This caused the recv call to recieve loads of rubbish when an error occured.

I changed ssize_t to Int64(as it is in unix).

Reply by email

Florian Klaempfl
to Ales Katona
Ales Katona wrote 11 lines
There is an ugly type bug in win32 sockets.pp. This patch fixes it. ssize_t = cuint16 -- this caused a bug with fprecv/fprecvfrom and fpsend/fpsendto calls because winsock.recv[from]/winsock.send[to] calls return a longint while fprecv used an unsigned int as return value. This caused the recv call to recieve loads of rubbish when an error occured. I changed ssize_t to Int64(as it is in unix).

Applied, thx.

Reply by email