Skip to content

Commit

Permalink
added correct error code for WSASocketW failure fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
AviKozokin committed Dec 2, 2019
1 parent fdc0011 commit fa8b549
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libstd/sys/windows/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl Socket {
c::WSA_FLAG_OVERLAPPED | c::WSA_FLAG_NO_HANDLE_INHERIT) {
c::INVALID_SOCKET => {
match c::WSAGetLastError() {
c::WSAEPROTOTYPE => {
c::WSAEPROTOTYPE | c::WSAEINVAL => {
match c::WSASocketW(fam, ty, 0, ptr::null_mut(), 0,
c::WSA_FLAG_OVERLAPPED) {
c::INVALID_SOCKET => Err(last_error()),
Expand Down Expand Up @@ -199,7 +199,7 @@ impl Socket {
c::WSA_FLAG_OVERLAPPED | c::WSA_FLAG_NO_HANDLE_INHERIT) {
c::INVALID_SOCKET => {
match c::WSAGetLastError() {
c::WSAEPROTOTYPE => {
c::WSAEPROTOTYPE | c::WSAEINVAL => {
match c::WSASocketW(info.iAddressFamily,
info.iSocketType,
info.iProtocol,
Expand Down

0 comments on commit fa8b549

Please sign in to comment.