diff options
Diffstat (limited to 'extra/yassl/src/yassl_int.cpp')
-rw-r--r-- | extra/yassl/src/yassl_int.cpp | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/extra/yassl/src/yassl_int.cpp b/extra/yassl/src/yassl_int.cpp index 1a407ca8ba5..ae16abf9e49 100644 --- a/extra/yassl/src/yassl_int.cpp +++ b/extra/yassl/src/yassl_int.cpp @@ -1,27 +1,20 @@ -/* yassl_int.cpp - * - * Copyright (C) 2003 Sawtooth Consulting Ltd. - * - * This file is part of yaSSL. - * - * yaSSL is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * There are special exceptions to the terms and conditions of the GPL as it - * is applied to yaSSL. View the full text of the exception in the file - * FLOSS-EXCEPTIONS in the directory of this software distribution. - * - * yaSSL is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ +/* + Copyright (C) 2000-2007 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA. +*/ /* yaSSL internal source implements SSL supporting types not specified in the @@ -298,7 +291,7 @@ const ClientKeyFactory& sslFactory::getClientKey() const SSL::SSL(SSL_CTX* ctx) : secure_(ctx->getMethod()->getVersion(), crypto_.use_random(), ctx->getMethod()->getSide(), ctx->GetCiphers(), ctx, - ctx->GetDH_Parms().set_) + ctx->GetDH_Parms().set_), has_data_(false) { if (int err = crypto_.get_random().GetError()) { SetError(YasslError(err)); @@ -1054,6 +1047,8 @@ void SSL::fillData(Data& data) if (data.get_length() == dataSz) break; } + + if (buffers_.getData().size() == 0) has_data_ = false; // none left } @@ -1389,9 +1384,17 @@ bool SSL::isTLSv1_1() const } +// is there buffered data available, optimization to remove iteration on buffer +bool SSL::HasData() const +{ + return has_data_; +} + + void SSL::addData(input_buffer* data) { buffers_.useData().push_back(data); + if (!has_data_) has_data_ = true; } |