[Modify] Polish it

This commit is contained in:
sta 2020-03-18 19:46:15 +09:00
parent 46f4649106
commit 5ed71dad88

View File

@ -876,15 +876,24 @@ namespace WebSocketSharp.Net
} }
private void doWithCheckingState ( private void doWithCheckingState (
Action <string, string> action, string name, string value, bool setState) Action <string, string> action, string name, string value, bool setState
)
{ {
var type = checkHeaderType (name); var headerType = checkHeaderType (name);
if (type == HttpHeaderType.Request)
doWithCheckingState (action, name, value, false, setState); if (headerType == HttpHeaderType.Response) {
else if (type == HttpHeaderType.Response)
doWithCheckingState (action, name, value, true, setState); doWithCheckingState (action, name, value, true, setState);
else
action (name, value); return;
}
if (headerType == HttpHeaderType.Request) {
doWithCheckingState (action, name, value, false, setState);
return;
}
action (name, value);
} }
private void doWithCheckingState ( private void doWithCheckingState (