lcore.org gitweb
/
lcore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
getsockname fixes. getXaddr was returning peer addr
[lcore.git]
/
lsocket.pas
diff --git
a/lsocket.pas
b/lsocket.pas
index f7d40e39679925f4c9f13493bd57eb5121e435c1..af3faf8553e5bf63a22e40a6df41f6e1f0cda2f9 100755
(executable)
--- a/
lsocket.pas
+++ b/
lsocket.pas
@@
-177,6
+177,10
@@
end;
begin
\r
result := getpeername(sock,addr,addrlen);
\r
end;
\r
begin
\r
result := getpeername(sock,addr,addrlen);
\r
end;
\r
+ function system_getsocketname(Sock: LongInt;var Addr;var Addrlen: LongInt):LongInt;
\r
+ begin
\r
+ result := getsocketname(sock,addr,addrlen);
\r
+ end;
\r
function system_listen(Sock: LongInt; MaxConnect: LongInt):Boolean;
\r
begin
\r
result := listen(sock,maxconnect);
\r
function system_listen(Sock: LongInt; MaxConnect: LongInt):Boolean;
\r
begin
\r
result := listen(sock,maxconnect);
\r
@@
-686,7
+690,7
@@
begin
{$ifdef win32}
\r
winsock.getsockname(self.fdhandlein,psockaddr(@addr)^,i);
\r
{$else}
\r
{$ifdef win32}
\r
winsock.getsockname(self.fdhandlein,psockaddr(@addr)^,i);
\r
{$else}
\r
- getsocketname(self.fdhandlein,addr,i);
\r
+
system_
getsocketname(self.fdhandlein,addr,i);
\r
{$endif}
\r
binip := inaddrvtobinip(addr);
\r
converttov4(binip);
\r
{$endif}
\r
binip := inaddrvtobinip(addr);
\r
converttov4(binip);
\r
@@
-737,7
+741,7
@@
begin
winsock.getsockname(self.fdhandlein,psockaddrin(@addr)^,i);
\r
\r
{$else}
\r
winsock.getsockname(self.fdhandlein,psockaddrin(@addr)^,i);
\r
\r
{$else}
\r
- getsocketname(self.fdhandlein,addr,i);
\r
+
system_
getsocketname(self.fdhandlein,addr,i);
\r
\r
{$endif}
\r
result := inttostr(htons(addr.InAddr.port));
\r
\r
{$endif}
\r
result := inttostr(htons(addr.InAddr.port));
\r