From: Alexander P. <ale...@us...> - 2010-01-29 17:53:18
|
Build Version : T3.0.0.27502 Firebird 3.0 Unstable (writeBuildNum.sh,v 1.27675 2010/01/29 17:53:08 alexpeshkof ) Update of /cvsroot/firebird/firebird2/src/remote In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv29281 Modified Files: interface.cpp Log Message: Better fix for trusted authentication problem Index: interface.cpp =================================================================== RCS file: /cvsroot/firebird/firebird2/src/remote/interface.cpp,v retrieving revision 1.234 retrieving revision 1.235 diff -b -U3 -r1.234 -r1.235 --- interface.cpp 29 Jan 2010 13:08:53 -0000 1.234 +++ interface.cpp 29 Jan 2010 17:53:07 -0000 1.235 @@ -5612,6 +5612,10 @@ MemoryPool& pool = *getDefaultMemoryPool(); port->port_deferred_packets = FB_NEW(pool) PacketQueue(pool); + // current instance name + const char* nm; + USHORT len; + // Let plugins try to add data to DPB in order to avoid extra network roundtrip AutoPtr<Auth::ClientInstance, Auth::Auto> currentInstance; Auth::DpbImplementation di(dpb); @@ -5625,6 +5629,7 @@ { // plugin may be used currentInstance.reset(list[sequence]->instance()); + list[sequence]->getName(&nm, &len); switch(currentInstance->startAuthentication(op == op_service_attach, file_name.c_str(), &di)) { @@ -5729,15 +5734,22 @@ } bool contFlag = true; - if (!n || !n->cstr_length) + if (n && n->cstr_length && currentInstance.hasData()) + { + // if names match, do not reset instance + if (len == n->cstr_length && memcmp(nm, n->cstr_address, len) == 0) + { + n = NULL; + } + } + + if (n && n->cstr_length) { // switch to other plugin currentInstance.reset(0); for (sequence = 0; list[sequence]; ++sequence) { - const char* nm; - USHORT len; list[sequence]->getName(&nm, &len); if (len == n->cstr_length && memcmp(nm, n->cstr_address, len) == 0) { |