10-27-2024, 09:57 PM
(This post was last modified: 10-27-2024, 10:27 PM by Justin Case.)
(10-27-2024, 09:39 PM)rlebeau Wrote:(10-27-2024, 08:27 PM)Justin Case Wrote: My Client is failing to logon to my server now and I think this is an upgrade woe (I'm using 10.6.3.3)
What version are you upgrading from?
It was 10.2.3 - very old! I'm using Delphi 6.
(10-27-2024, 09:39 PM)rlebeau Wrote:(10-27-2024, 08:27 PM)Justin Case Wrote: The client sends a string command like this: logon¦<username>¦password
Why is the client using a non-ASCII character as a token separator? What version of Delphi (or other programming language) is the client using?
Delphi 6 for both Server and Client.
It's the character I've always used - even in Indy 8 and 9 - the ¦ (166) character always seemed a good non-obvious one that a user was unlikely to type in. As for whether it's ASCII or not, I just assumed if it was on a computer keyboard, it was ok to use and as v8 and 9 had no problems with it, I've always used it - even in the previous version 10 that I was using.
The CmdDelimiter and ParamDelimiter for all my command handlers are set to #166 and have been for years - and it worked well.
(10-27-2024, 09:39 PM)rlebeau Wrote: The ASCII pipe character is | (124, $7C), not ¦ (166, $AC).
I don't think I mentioned the pipe character? (I may well be wrong though, I have a habit of making myself look daft)
(10-27-2024, 09:39 PM)rlebeau Wrote:(10-27-2024, 08:27 PM)Justin Case Wrote: After being stumped as to it not working anymore, I ended up doing a debug and seeing that the clients TCP thread is sending it but the server isn't happy - and sends back a 400 quoting it with ? instead of ¦
That means you have a charset mismatch between the client and server. Indy's default charset is ASCII. Clearly the client is not sending ASCII. So, what charset is it actually using?
Well that's just it - I've not set a charset on the client or server so as far as I'm concerned they are supposed to be using the same - and they are running on the same WinXP virtual machine with the Delphi 6 IDE.
(10-27-2024, 09:39 PM)rlebeau Wrote:(10-27-2024, 08:27 PM)Justin Case Wrote: This never used to happen. Why does it happen now?
Indy 10 has always behaved this way, at least since the migration to Unicode around 2009.
But it didn't do this in the previous 10.2.3 that I was using? - even though I can see the same code in the source for it!
(10-27-2024, 09:39 PM)rlebeau Wrote: You will need to match that charset on the server, ie by setting the AContext.Connection.IOHandler.DefStringEncoding property
I have no idea what values to use there? - it's defined as a property of IIdTextEncoding but I can't find a definition for IIdTextEncoding anywhere to know what i can use as a value
Ok, eventually I managed to find: IdTextEncodingType = (encIndyDefault, encOSDefault, enc8Bit, encASCII, encUTF16BE, encUTF16LE, encUTF7, encUTF8);
It was below the type definition for IIdTextEncoding which is a interface with a load of functions... so I'm not sure how I'm supposed to change the the AContext.Connection.IOHandler.DefStringEncoding property..
Tried this: AContext.Connection.IOHandler.DefStringEncoding := encIndyDefault;
"[Error] Server_Main_Source.pas(603): Incompatible types: 'IdTextEncodingType' and 'IIdTextEncoding'"
Tried this (invalid typecast it said): AContext.Connection.IOHandler.DefStringEncoding := IIdTextEncoding(encIndyDefault);

