From 36d5c3cb447901ffff6a02a438e1d422cb806147 Mon Sep 17 00:00:00 2001 From: "davidben@webrtc.org" Date: Thu, 22 Jan 2015 23:06:17 +0000 Subject: [PATCH] Leave BIO_METHOD non-const. This breaks building against OpenSSL upstream, which is still supported on iOS. This reverts part of https://webrtc-codereview.appspot.com/34649004. BUG=none R=juberti@webrtc.org Review URL: https://webrtc-codereview.appspot.com/36879004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@8132 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/base/openssladapter.cc | 5 +++-- webrtc/base/opensslstreamadapter.cc | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/webrtc/base/openssladapter.cc b/webrtc/base/openssladapter.cc index 5caad17c67..56610fa240 100644 --- a/webrtc/base/openssladapter.cc +++ b/webrtc/base/openssladapter.cc @@ -74,7 +74,8 @@ 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 const BIO_METHOD methods_socket = { +// TODO(davidben): This should be const once BoringSSL is assumed. +static BIO_METHOD methods_socket = { BIO_TYPE_BIO, "socket", socket_write, @@ -87,7 +88,7 @@ static const BIO_METHOD methods_socket = { NULL, }; -static const BIO_METHOD* BIO_s_socket2() { return(&methods_socket); } +static BIO_METHOD* BIO_s_socket2() { return(&methods_socket); } static BIO* BIO_new_socket(rtc::AsyncSocket* socket) { BIO* ret = BIO_new(BIO_s_socket2()); diff --git a/webrtc/base/opensslstreamadapter.cc b/webrtc/base/opensslstreamadapter.cc index c88ae04fc7..c18295f577 100644 --- a/webrtc/base/opensslstreamadapter.cc +++ b/webrtc/base/opensslstreamadapter.cc @@ -67,7 +67,8 @@ 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 const BIO_METHOD methods_stream = { +// TODO(davidben): This should be const once BoringSSL is assumed. +static BIO_METHOD methods_stream = { BIO_TYPE_BIO, "stream", stream_write, @@ -80,7 +81,7 @@ static const BIO_METHOD methods_stream = { NULL, }; -static const BIO_METHOD* BIO_s_stream() { return(&methods_stream); } +static BIO_METHOD* BIO_s_stream() { return(&methods_stream); } static BIO* BIO_new_stream(StreamInterface* stream) { BIO* ret = BIO_new(BIO_s_stream());