Index: ppapi/proxy/tcp_socket_resource_base.cc |
diff --git a/ppapi/proxy/tcp_socket_resource_base.cc b/ppapi/proxy/tcp_socket_resource_base.cc |
index 39c9fa311d68f75f8d40589f3bd8c54ebcd53aa1..fb4db5bee64a584dde7ec4697b7ead75d025d2be 100644 |
--- a/ppapi/proxy/tcp_socket_resource_base.cc |
+++ b/ppapi/proxy/tcp_socket_resource_base.cc |
@@ -318,11 +318,12 @@ void TCPSocketResourceBase::CloseImpl() { |
int32_t TCPSocketResourceBase::SetOptionImpl( |
PP_TCPSocket_Option name, |
const PP_Var& value, |
+ bool check_connect_state, |
scoped_refptr<TrackedCallback> callback) { |
SocketOptionData option_data; |
switch (name) { |
case PP_TCPSOCKET_OPTION_NO_DELAY: { |
- if (!state_.IsConnected()) |
+ if (check_connect_state && !state_.IsConnected()) |
return PP_ERROR_FAILED; |
if (value.type != PP_VARTYPE_BOOL) |
@@ -332,7 +333,7 @@ int32_t TCPSocketResourceBase::SetOptionImpl( |
} |
case PP_TCPSOCKET_OPTION_SEND_BUFFER_SIZE: |
case PP_TCPSOCKET_OPTION_RECV_BUFFER_SIZE: { |
- if (!state_.IsConnected()) |
+ if (check_connect_state && !state_.IsConnected()) |
return PP_ERROR_FAILED; |
if (value.type != PP_VARTYPE_INT32) |