* fix a race condition.
when multiple call to GetStream happens around the same time, on the
same inputIndex, a race condition will cause this.buffers.Add() to throw
exception.
* add WebSocket server certificate validation support for net 452
* port forwarding bug fix
In StreamDemuxer, if the buffer is created before connection is established, the port bytes are not removed when
the bytes are delivering to the client. Repro code looks like (the key is to call remoteStreams.Start AFTER
GetStream):
var ws = await kubernetesClient.WebSocketNamespacedPodPortForwardAsync (... )
var remoteStreams = new StreamDemuxer(ws);
var stream = remoteStreams.GetStream(0, 0);
remoteStreams.Start();
This change filters out the port bytes which are the 2nd and 3rd bytes sent in all cases.
* incorporate review feedbacks.
add an enum StreamType to StreamDemuxer so it knows whether / how
the data stream should be handled.
* add tests, fix skip bytes scenario for multiple streams
* add more tests for verifying content.
* simplify code a bit
* fix a race condition.
when multiple call to GetStream happens around the same time, on the
same inputIndex, a race condition will cause this.buffers.Add() to throw
exception.
* add WebSocket server certificate validation support for net 452
* Remove requirement for certificate authority data in kubeconfig.
* Update src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs
Update casing of `URL` at @itowlson suggestion.
Co-Authored-By: twitchax <twitchax@gmail.com>
* Create KubernetesClientConfiguration from pre-loaded K8SConfiguration
* Tweaked a couple more doc strings
* Fix duplicated tests
* Give the new method a more informative name
when multiple call to GetStream happens around the same time, on the
same inputIndex, a race condition will cause this.buffers.Add() to throw
exception.
* Update WatcherDelegatingHandler to stop eating first line (#183)
* Override Read methods in PeekableStreamReader to avoid unpredicted behaviour (#183)
Override Read methods in PeekableStreamReader to avoid unpredicted behaviour (#183)
* Watcher: Add onClosed event and callback
* Update the code generators to accept the onClose callback
* Re-generate API
* Update unit tests
* Fix unit test
* Watcher fixes/improvements:
- Run Task.Yield at the beginning to make sure we're running async
- Set Watching = false before invoking OnClosed, to make sure the callers see a consistent state.