summaryrefslogtreecommitdiff
path: root/sql/threadpool_common.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-02-17 23:27:15 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2012-02-17 23:27:15 +0100
commit2a5d8ea9a201a1bf33fe309b8293e31ebd961e60 (patch)
tree25cd2759395705fc28c3d11ed401e9b5ed9d6230 /sql/threadpool_common.cc
parentb932e57b27e413872a76deb082ccc425949a67ca (diff)
downloadmariadb-git-2a5d8ea9a201a1bf33fe309b8293e31ebd961e60.tar.gz
Added copiright, some more comments
Diffstat (limited to 'sql/threadpool_common.cc')
-rw-r--r--sql/threadpool_common.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index d003bae6727..03ccb3fa861 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -1,3 +1,18 @@
+/* Copyright (C) 2012 Monty Program 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; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
#include <my_global.h>
#include <violite.h>
#include <sql_priv.h>
@@ -171,6 +186,9 @@ void threadpool_remove_connection(THD *thd)
worker_context.restore();
}
+/**
+ Process a single client request or a single batch.
+*/
int threadpool_process_request(THD *thd)
{
int retval= 0;
@@ -190,6 +208,15 @@ int threadpool_process_request(THD *thd)
}
+ /*
+ In the loop below, the flow is essentially the copy of thead-per-connections
+ logic, see do_handle_one_connection() in sql_connect.c
+
+ The goal is to execute a single query, thus the loop is normally executed
+ only once. However for SSL connections, it can be executed multiple times
+ (SSL can preread and cache incoming data, and vio->has_data() checks if it
+ was the case).
+ */
for(;;)
{
Vio *vio;