WebCmdlet unix-sockets#19343
Conversation
|
Unrelated test error |
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Show resolved
Hide resolved
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Show resolved
Hide resolved
src/Microsoft.PowerShell.Commands.Utility/resources/WebCmdletStrings.resx
Outdated
Show resolved
Hide resolved
|
I wonder whether we should handle |
| get => _unixSocket; | ||
| set | ||
| { | ||
| if (Socket.OSSupportsUnixDomainSockets is true) |
There was a problem hiding this comment.
Is it possible to create UnixSocket if Socket.OSSupportsUnixDomainSockets is false? I guess no. So it makes no sense to add the check.
There was a problem hiding this comment.
@iSazonov unfortunately I can't check at the moment, could you test what happens if Socket.OSSupportsUnixDomainSockets is false?
There was a problem hiding this comment.
UnixDomainSocketEndPoint throws https://source.dot.net/#System.Net.Sockets/System/Net/Sockets/UnixDomainSocketEndPoint.cs,59
There was a problem hiding this comment.
Actually System.Net.Sockets.Socket..ctor(AddressFamily, SocketType, ProtocolType) will throw a SocketException with the message "An address incompatible with the requested protocol was used":
There was a problem hiding this comment.
The implementation an Windows will attempt to create create a socket by calling the underlying Winsock API:
There was a problem hiding this comment.
Is it possible to create UnixSocket if Socket.OSSupportsUnixDomainSockets is false? I guess no. So it makes no sense to add the check.
We probably want to perform the check so that we can create the appropriate ErrorRecord with a more informative message, i.e.:
if (!Socket.OSSupportsUnixDomainSockets)
ThrowTerminatingError(GetUnixDomainSocketNotSupportedError())
```</strike>There was a problem hiding this comment.
That being said, the error handling of System.Net.Sockets.SocketPal.CreateSocket could be improved.
…trings.resx Co-authored-by: xtqqczze <[email protected]>
Co-authored-by: xtqqczze <[email protected]>
test/powershell/Modules/Microsoft.PowerShell.Utility/WebCmdlets.Tests.ps1
Outdated
Show resolved
Hide resolved
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
...t.PowerShell.Commands.Utility/commands/utility/WebCmdlet/Common/WebRequestPSCmdlet.Common.cs
Show resolved
Hide resolved
|
@SteveL-MSFT |
I agree with @iSazonov, error handling is not required, see #19343 (comment). |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
1 similar comment
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
@CarloToso The markdown spelling check failed. Please fix the markdown spelling issues. |
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
PR Summary
Replaces #18995 after the changes in #19249
HttpClientHanlderwithSocketsHttpHandlerSyntax:
curl --unix-socket /var/run/docker.sock http://v1.40/images/jsonInvoke-WebRequest -Uri "http://v1.40/images/json/" -UnixSocket "/var/run/docker.sock"TODO:
Add specific tests (Help Wanted)DONEAdd documentationDONEPR Context
fix #12060
fix #8314
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).