Sign in Join

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

Mailing lists / fpc-devel / 2026-05

Problem in fphttpserver.pp?

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

David Connolly

Hi all,

I have a simple server (included) that has stopped working due to some changes to fphttpserver or the sockets code.

The problem, as far as my limited knowledge goes, seems to stem from FSocket.RemoteEndpoint.First.Address in fphttpserver.pp

Replacing the FSocket.RemoteEndpoint.First.Address with HostAddrToStr(Data.RemoteAddress.sin_addr) - the old code - fixes the issue.

Printing out FSocket.RemoteEndpoint.First.Address displays nothing.

To test the included program, run it and "curl -d some=data http://127.0.0.1:8889"

FPC 3.3.1 (latest) Linux x86_64 (Debian 13.5)

Keep up the great work,

Regards,
David

Reply by email

Michael Van Canneyt
to David Connolly
David Connolly wrote 16 lines
Hi all, I have a simple server (included) that has stopped working due to some changes to fphttpserver or the sockets code. The problem, as far as my limited knowledge goes, seems to stem from FSocket.RemoteEndpoint.First.Address in fphttpserver.pp Replacing the FSocket.RemoteEndpoint.First.Address with HostAddrToStr(Data.RemoteAddress.sin_addr) - the old code - fixes the issue. Printing out FSocket.RemoteEndpoint.First.Address displays nothing. To test the included program, run it and "curl -d some=data http://127.0.0.1:8889"

Indeed, I can reproduce.
Looks like some uninitialized value, I'll need to debug that.

I've reverted the FSocket.RemoteEndpoint.First.Address stuff so no-one is blocked.

Thanks for pointing it out!

Michael.

Reply by email