I also think you're missing the point about the cause of the bad return. If the B3 never had an easyfind name, in which case I presume the database entry will be holding a NULL value, than the response is an error state with a message attached to it.
Again, this is not how it works. The validation tables and the dns tables are not the same data system. THe production is just a lookup service.
were having issues because they were not escaped correctly - or so you assumed.
Yes, and in contrast to your assumption, I verified this checked afterwards. THe problem is that sometimes the B3 uses GET (which is encrpted) and sometime POST (which is not) but the server end does not realize this. It documented in the other thread. However this is completely unrelated to your code, as you are looking at CLIENT code and I was discussing SERVER code. The client does not get to decode the key from the server as it does not receive one.
Here's wat a successful return looks like:
Code: Select all
{"error":false,"opcode":1,"operation":"IPupdate","record":{"id":"1905","domain_id":"1","name":"ubi.myownb3.com","type":"A","content":"211.131.66.67"}}
See: there is no key
As you mentioned, here's indeed the reason why it could not find your key, as you entered a windows-style newline in the key:
Code: Select all
SELECT * FROM units WHERE mac1='00:22:02:00:##:22' and secret='##########bOkZbF1zlFXsOVOBU=\r\n'
after that it works without errors.
(yes: mac1 in the DB table is mac0 on the system. I didnt make this up).
As for units 15377, 16144 and 16742, there is no mention in the logs of these boxes ever announcing themselves.
yes the client code is ugly in returning inconsistent answers, but it is only ugly if you deliberately break the communication. Apart from your sense of aesthetics, why is this a problem?
I changed the error codes a bit to be more informative. I also added a unique identifier to the server code that is embedded in the server log as well in the JSON output. I propose that future discussions always contain these uids so all knwo we're talking about the same stuff without posting secrets.