aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-07-13 20:20:11 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2013-07-13 20:20:11 +0300
commit988476b40eaf7038b5d35bc1fba44aad0c74d013 (patch)
treedc91a8649a844036d840444856240b7a673199ac /src
parent962a2c10673614b080cd89a8a6a77091f16a5bc7 (diff)
downloadvmod-dbrw-988476b40eaf7038b5d35bc1fba44aad0c74d013.tar.gz
vmod-dbrw-988476b40eaf7038b5d35bc1fba44aad0c74d013.tar.bz2
Bugfix.
* src/vmod_dbrw.c (get_connection): Save connection pointer as thread-specific data.
Diffstat (limited to 'src')
-rw-r--r--src/vmod_dbrw.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vmod_dbrw.c b/src/vmod_dbrw.c
index cd7d434..8afaf04 100644
--- a/src/vmod_dbrw.c
+++ b/src/vmod_dbrw.c
@@ -492,6 +492,12 @@ get_connection(struct dbrw_config *conf)
free(cp);
return NULL;
}
+ if (pthread_setspecific(thread_key, cp)) {
+ dbrw_error("cannot set thread-specific data");
+ sql_destroy(cp);
+ free(cp);
+ return NULL;
+ }
}
return cp;
}

Return to:

Send suggestions and report system problems to the System administrator.