[Modify] Polish it

This commit is contained in:
sta 2020-03-17 21:52:18 +09:00
parent 71cfca9ac3
commit 46f4649106

View File

@ -888,12 +888,22 @@ namespace WebSocketSharp.Net
}
private void doWithCheckingState (
Action <string, string> action, string name, string value, bool response, bool setState)
Action <string, string> action,
string name,
string value,
bool response,
bool setState
)
{
checkState (response);
action (name, value);
if (setState && _state == HttpHeaderType.Unspecified)
_state = response ? HttpHeaderType.Response : HttpHeaderType.Request;
setState = setState && _state == HttpHeaderType.Unspecified;
if (!setState)
return;
_state = response ? HttpHeaderType.Response : HttpHeaderType.Request;
}
private void doWithoutCheckingName (Action <string, string> action, string name, string value)