Re: [Sqlrelay-discussion] SQLRelay hangs with incorrect connection string
Brought to you by:
mused
|
From: Firstworks/4access <dav...@fi...> - 2005-08-31 15:19:40
|
Looks like there's a bug in the sqlr-listener.
If you edit src/listener/sqlrlistener.C and look for the clientSession()
function, there's a bit of code like this in the function:
// snooze before and after returning an
// authentication error to discourage
// brute-force password attacks
snooze::macrosnooze(2);
clientsock->write((unsigned short)ERROR);
snooze::macrosnooze(2);
(or something similar)
insert a call to flushWriteBuffer(clientsock)
directly after the call to clientsock->write() and
it should fix the problem.
Dave
dav...@fi...
On Wed, 2005-08-31 at 10:53 +0200, Maciej Wisniowski wrote:
> Hi
>
> I've just ecountered one problem with connection parameters to SQLRelay
>
> . In sqlrelay.conf I have:
>
> <instance id="xadm" port="9004"
> socket="/tmp/xadm.socket"
> dbase="oracle7" connections="3" maxconnections="5"
> maxqueuelength="0"
> growby="1" ttl="60" endofsession="commit"
> sessiontimeout="600" runasuser="nobody"
> runasgroup="nobody" cursors="5"
> authtier="listener" handoff="pass"
> debug="None">
> <users>
> <user user="test" password="test"/>
> </users>
> <connections>
> <connection connectionid="xadm"
> string="user=xadm;password=xadm;oracle_sid=devz" metric="1"/>
> </connections>
> </instance>
>
>
> when using script like this:
>
> // ------------------------------------------------------------
> from SQLRelay import PySQLRClient
> from SQLRelay import PySQLRDB
>
> con=PySQLRDB.connect('localhost',9004,'','test','test',0,1)
> cur=PySQLRClient.sqlrcursor(con)
> res = cur.sendQuery('select * from xxx')
> // ------------------------------------------------------------
>
> everything is OK (ORA exception is thrown (table xxx not known)
> and res == 0)
> but changing connection string to:
>
> con=PySQLRDB.connect('localhost',9004,'','test','testx',0,1)
>
> (here is incorrect password: testx) causes script to
> hang waiting for response...
>
> This is PythonAPI and SQLRelay 0.36.4.
> Is this a bug or my config file or script is wrong?
>
|