Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Side by Side Diff: net/socket/ssl_server_socket_openssl.cc

Issue 401153002: Switch to BoringSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase across DEPS change Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/ssl_server_socket_openssl.h" 5 #include "net/socket/ssl_server_socket_openssl.h"
6 6
7 #include <openssl/err.h> 7 #include <openssl/err.h>
8 #include <openssl/ssl.h> 8 #include <openssl/ssl.h>
9 9
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 298
299 // Return 0 for EOF, 299 // Return 0 for EOF,
300 // > 0 for bytes transferred immediately, 300 // > 0 for bytes transferred immediately,
301 // < 0 for error (or the non-error ERR_IO_PENDING). 301 // < 0 for error (or the non-error ERR_IO_PENDING).
302 int SSLServerSocketOpenSSL::BufferSend() { 302 int SSLServerSocketOpenSSL::BufferSend() {
303 if (transport_send_busy_) 303 if (transport_send_busy_)
304 return ERR_IO_PENDING; 304 return ERR_IO_PENDING;
305 305
306 if (!send_buffer_.get()) { 306 if (!send_buffer_.get()) {
307 // Get a fresh send buffer out of the send BIO. 307 // Get a fresh send buffer out of the send BIO.
308 size_t max_read = BIO_ctrl_pending(transport_bio_); 308 size_t max_read = BIO_pending(transport_bio_);
309 if (!max_read) 309 if (!max_read)
310 return 0; // Nothing pending in the OpenSSL write BIO. 310 return 0; // Nothing pending in the OpenSSL write BIO.
311 send_buffer_ = new DrainableIOBuffer(new IOBuffer(max_read), max_read); 311 send_buffer_ = new DrainableIOBuffer(new IOBuffer(max_read), max_read);
312 int read_bytes = BIO_read(transport_bio_, send_buffer_->data(), max_read); 312 int read_bytes = BIO_read(transport_bio_, send_buffer_->data(), max_read);
313 DCHECK_GT(read_bytes, 0); 313 DCHECK_GT(read_bytes, 0);
314 CHECK_EQ(static_cast<int>(max_read), read_bytes); 314 CHECK_EQ(static_cast<int>(max_read), read_bytes);
315 } 315 }
316 316
317 int rv = transport_socket_->Write( 317 int rv = transport_socket_->Write(
318 send_buffer_.get(), 318 send_buffer_.get(),
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 677
678 mode.ConfigureFlag(SSL_MODE_RELEASE_BUFFERS, true); 678 mode.ConfigureFlag(SSL_MODE_RELEASE_BUFFERS, true);
679 679
680 SSL_set_mode(ssl_, mode.set_mask); 680 SSL_set_mode(ssl_, mode.set_mask);
681 SSL_clear_mode(ssl_, mode.clear_mask); 681 SSL_clear_mode(ssl_, mode.clear_mask);
682 682
683 return OK; 683 return OK;
684 } 684 }
685 685
686 } // namespace net 686 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_client_socket_openssl.cc ('k') | net/socket/ssl_session_cache_openssl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698