OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 CreateCricketSocket(addr.family()); | 172 CreateCricketSocket(addr.family()); |
173 } | 173 } |
174 if (cricket_socket_->Connect(addr) < 0) { | 174 if (cricket_socket_->Connect(addr) < 0) { |
175 return cricket_socket_->IsBlocking(); | 175 return cricket_socket_->IsBlocking(); |
176 } | 176 } |
177 return true; | 177 return true; |
178 } | 178 } |
179 | 179 |
180 bool XmppSocket::Read(char * data, size_t len, size_t* len_read) { | 180 bool XmppSocket::Read(char * data, size_t len, size_t* len_read) { |
181 #ifndef USE_SSLSTREAM | 181 #ifndef USE_SSLSTREAM |
182 int read = cricket_socket_->Recv(data, len); | 182 int read = cricket_socket_->Recv(data, len, nullptr); |
183 if (read > 0) { | 183 if (read > 0) { |
184 *len_read = (size_t)read; | 184 *len_read = (size_t)read; |
185 return true; | 185 return true; |
186 } | 186 } |
187 #else // USE_SSLSTREAM | 187 #else // USE_SSLSTREAM |
188 rtc::StreamResult result = stream_->Read(data, len, len_read, NULL); | 188 rtc::StreamResult result = stream_->Read(data, len, len_read, NULL); |
189 if (result == rtc::SR_SUCCESS) | 189 if (result == rtc::SR_SUCCESS) |
190 return true; | 190 return true; |
191 #endif // USE_SSLSTREAM | 191 #endif // USE_SSLSTREAM |
192 return false; | 192 return false; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 #endif // USE_SSLSTREAM | 237 #endif // USE_SSLSTREAM |
238 state_ = buzz::AsyncSocket::STATE_TLS_CONNECTING; | 238 state_ = buzz::AsyncSocket::STATE_TLS_CONNECTING; |
239 return true; | 239 return true; |
240 #else // !defined(FEATURE_ENABLE_SSL) | 240 #else // !defined(FEATURE_ENABLE_SSL) |
241 return false; | 241 return false; |
242 #endif // !defined(FEATURE_ENABLE_SSL) | 242 #endif // !defined(FEATURE_ENABLE_SSL) |
243 } | 243 } |
244 | 244 |
245 } // namespace buzz | 245 } // namespace buzz |
246 | 246 |
OLD | NEW |