Always tag SRTP_PROTECTION_PROFILE and BIO_METHOD as const.

The BIO_METHODs ought to be const so they can go into rodata; BoringSSL makes
BIO_new take a const BIO_METHOD *, so there's no need for it to be non-const.
Also set SRTP_PROTECTION_PROFILE as const so we can constify those within
BoringSSL (https://boringssl-review.googlesource.com/#/c/2720/)

BUG=none
R=henrike@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/34649004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@8013 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org 2015-01-07 17:59:28 +00:00
parent dfef02824c
commit c10eceab6e
2 changed files with 5 additions and 5 deletions

View File

@ -74,7 +74,7 @@ static long socket_ctrl(BIO* h, int cmd, long arg1, void* arg2);
static int socket_new(BIO* h);
static int socket_free(BIO* data);
static BIO_METHOD methods_socket = {
static const BIO_METHOD methods_socket = {
BIO_TYPE_BIO,
"socket",
socket_write,
@ -87,7 +87,7 @@ static BIO_METHOD methods_socket = {
NULL,
};
static BIO_METHOD* BIO_s_socket2() { return(&methods_socket); }
static const BIO_METHOD* BIO_s_socket2() { return(&methods_socket); }
static BIO* BIO_new_socket(rtc::AsyncSocket* socket) {
BIO* ret = BIO_new(BIO_s_socket2());

View File

@ -67,7 +67,7 @@ static long stream_ctrl(BIO* h, int cmd, long arg1, void* arg2);
static int stream_new(BIO* h);
static int stream_free(BIO* data);
static BIO_METHOD methods_stream = {
static const BIO_METHOD methods_stream = {
BIO_TYPE_BIO,
"stream",
stream_write,
@ -80,7 +80,7 @@ static BIO_METHOD methods_stream = {
NULL,
};
static BIO_METHOD* BIO_s_stream() { return(&methods_stream); }
static const BIO_METHOD* BIO_s_stream() { return(&methods_stream); }
static BIO* BIO_new_stream(StreamInterface* stream) {
BIO* ret = BIO_new(BIO_s_stream());
@ -289,7 +289,7 @@ bool OpenSSLStreamAdapter::GetDtlsSrtpCipher(std::string* cipher) {
if (state_ != SSL_CONNECTED)
return false;
SRTP_PROTECTION_PROFILE *srtp_profile =
const SRTP_PROTECTION_PROFILE *srtp_profile =
SSL_get_selected_srtp_profile(ssl_);
if (!srtp_profile)