mirror of
https://github.com/wangyu-/udp2raw.git
synced 2025-01-19 14:29:34 +08:00
fixed get_sock_error() format on windows
This commit is contained in:
parent
0137dba1fd
commit
238e85a5e4
@ -105,7 +105,8 @@ int client_on_timer(conn_info_t &conn_info) //for client. called when a timer is
|
|||||||
{
|
{
|
||||||
setnonblocking(bind_fd);
|
setnonblocking(bind_fd);
|
||||||
int ret=connect(bind_fd,(struct sockaddr *)&remote_addr.inner,remote_addr.get_len());
|
int ret=connect(bind_fd,(struct sockaddr *)&remote_addr.inner,remote_addr.get_len());
|
||||||
mylog(log_info,"ret=%d,errno=%s,%d %s\n",ret,get_sock_error(),bind_fd,remote_addr.get_str());
|
mylog(log_debug,"ret=%d,errno=%s, %d %s\n",ret,get_sock_error(),bind_fd,remote_addr.get_str());
|
||||||
|
//mylog(log_info,"ret=%d,errno=,%d %s\n",ret,bind_fd,remote_addr.get_str());
|
||||||
conn_info.state.client_current_state=client_tcp_handshake_dummy;
|
conn_info.state.client_current_state=client_tcp_handshake_dummy;
|
||||||
mylog(log_info,"state changed from client_idle to client_tcp_handshake_dummy\n");
|
mylog(log_info,"state changed from client_idle to client_tcp_handshake_dummy\n");
|
||||||
}
|
}
|
||||||
|
@ -404,7 +404,11 @@ char *get_sock_error()
|
|||||||
(LPWSTR)&s, 0, NULL);
|
(LPWSTR)&s, 0, NULL);
|
||||||
sprintf(buf, "%d:%S", e,s);
|
sprintf(buf, "%d:%S", e,s);
|
||||||
int len=strlen(buf);
|
int len=strlen(buf);
|
||||||
if(len>0&&buf[len-1]=='\n') buf[len-1]=0;
|
while(len>0 && (buf[len-1]=='\r'||buf[len-1]=='\n' ))
|
||||||
|
{
|
||||||
|
len--;
|
||||||
|
buf[len]=0;
|
||||||
|
}
|
||||||
LocalFree(s);
|
LocalFree(s);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user