mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Fix getpeername() bug on Windows
The WIN32 getpeername() function returns ENOTCONN when it uses connect() the SOCK_NONBLOCK way. So we simply store the address, provided earlier.
This commit is contained in:
parent
908b7a82ca
commit
f3ce684aef
4 changed files with 71 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_CALLS_STRUCT_FD_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_CALLS_STRUCT_FD_INTERNAL_H_
|
||||
#include "libc/sock/struct/sockaddr.h"
|
||||
#include "libc/thread/thread.h"
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
@ -37,6 +38,7 @@ struct Fd {
|
|||
unsigned sndtimeo; /* millis; 0 means wait forever */
|
||||
void *connect_op;
|
||||
struct Cursor *cursor;
|
||||
struct sockaddr_storage peer;
|
||||
};
|
||||
|
||||
struct Fds {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue