Re: Encoding Arrays with File Paths

2025-02-26 Thread Bob Sneidar via use-livecode
When I encounter customer with such restrictions, I use my mobile hotspot for internet. I service a great many customers onsite in the LA area, and it’s been my experience that very few of them block traffic originating from within their own network. Health agencies and contractors are of course

Re: Encoding Arrays with File Paths

2025-02-26 Thread Richard Gaskin via use-livecode
Bob Sneidar wrote: > Sockets are by nature a 2 way communication. After I write to a socket > I can read from that socket and get back whatever the receiver returns. > In fact the whole premise of what I am doing depends on it. Yes, the socket connection is birectional, but establishing that conn

Re: Encoding Arrays with File Paths

2025-02-26 Thread Bob Sneidar via use-livecode
Sockets are by nature a 2 way communication. After I write to a socket I can read from that socket and get back whatever the receiver returns. In fact the whole premise of what I am foing depends on it. Bob S On Feb 25, 2025, at 9:10 PM, Richard Gaskin via use-livecode wrote: This excercise

Re: Encoding Arrays with File Paths

2025-02-26 Thread Bob Sneidar via use-livecode
I was having issues sending the encrypted data raw, but that may actually have been the issue I am now encountering, with the timing. I’ll try without base64encoding. Bob S On Feb 25, 2025, at 5:07 PM, Alex Tweedly via use-livecode wrote: Because I am encrypting the file data before sending

Re: Encoding Arrays with File Paths

2025-02-25 Thread Richard Gaskin via use-livecode
Alex Tweedly wrote: > Richard wrote: >> This excercise raises a question: rather than invent another protocol, >> why not use HTTP? > > > Usually, because HTTP is quite decidedly a client-server protocol. > If you have a peer-peer protocol need, then you have to bend HTTP > out of shape :-) Soc

Re: Encoding Arrays with File Paths

2025-02-25 Thread Alex Tweedly via use-livecode
On 25/02/2025 19:49, Bob Sneidar via use-livecode wrote: Because I developed my own encryption API which uses AES256 but has a couple tricks. SSL certs will not suffice, and the whole point to having my own encryption technique is so that I can avoid SSL certs and the process of registering

Re: Encoding Arrays with File Paths

2025-02-25 Thread Bob Sneidar via use-livecode
I played around with this last night, and determined that the length does not have to be sent, the receiving process can simply keep reading for n characters, appending the data to a low level file in a repeat loop until the it variable is empty. I tried this and the entire payload was received.

Re: Encoding Arrays with File Paths

2025-02-25 Thread Bob Sneidar via use-livecode
Because I developed my own encryption API which uses AES256 but has a couple tricks. SSL certs will not suffice, and the whole point to having my own encryption technique is so that I can avoid SSL certs and the process of registering them and installing them. Because I am encrypting the file

Re: Encoding Arrays with File Paths

2025-02-25 Thread Richard Gaskin via use-livecode
Bob Sneidar wrote: > I played around with this last night, and determined that the length does > not have to be sent, the receiving process can simply keep reading for n > characters, appending the data to a low level file in a repeat loop until > the it variable is empty. I tried this and the ent

Re: Encoding Arrays with File Paths

2025-02-24 Thread Alex Tweedly via use-livecode
On 25/02/2025 00:35, Bob Sneidar via use-livecode wrote: Okay I verified in my actual code. This is problematic if I don’t know how much data is actually going to be sent. I ended up with roughly 138,000 bytes before it choked. I supposed I could start with 128k chunks then dial it down if it’

Re: Encoding Arrays with File Paths

2025-02-24 Thread Bob Sneidar via use-livecode
Okay I verified in my actual code. This is problematic if I don’t know how much data is actually going to be sent. I ended up with roughly 138,000 bytes before it choked. I supposed I could start with 128k chunks then dial it down if it’s too much. I wish I know what the limiting factors are bec

Re: Encoding Arrays with File Paths

2025-02-24 Thread Mark Waddingham via use-livecode
On 2025-02-21 16:25, Bob Sneidar via use-livecode wrote: Yes and I replied to the ticket. The base64encoded data received is the same as that which was sent, so I do not think data length is the issue. Also if I send the file data just by itself without putting it into an array, the file arrive

Re: Encoding Arrays with File Paths

2025-02-21 Thread Bob Sneidar via use-livecode
Yes and I replied to the ticket. The base64encoded data received is the same as that which was sent, so I do not think data length is the issue. Also if I send the file data just by itself without putting it into an array, the file arrives at the server intact and can be base64Decoded and decryp

Re: Encoding Arrays with File Paths

2025-02-20 Thread Mark Waddingham via use-livecode
On 2025-02-20 18:21, Bob Sneidar via use-livecode wrote: Bug #24655 submitted. Looks like an incorrect use / invalid assumption about sockets to me ;) I've replied to the bug report but it looks like you are assuming that sending X bytes in one send command from the client can be read by one

Re: Encoding Arrays with File Paths

2025-02-20 Thread Bob Sneidar via use-livecode
Bug #24655 submitted. Bob S > On Feb 20, 2025, at 8:34 AM, Bob Sneidar wrote: > > Thanks Mark. > > Nice try but no cookie. I will file a bug report shortly. The error I am > geting with arrayDecode is: > > 672,49,1 > 465,49,1 > > I am sure that is a reference to the code in the library t

Re: Encoding Arrays with File Paths

2025-02-20 Thread Bob Sneidar via use-livecode
Thanks Mark. Nice try but no cookie. I will file a bug report shortly. The error I am geting with arrayDecode is: 672,49,1 465,49,1 I am sure that is a reference to the code in the library that encodes and decodes arrays. I haven’t gotten to the decryption bit yet. Bob S aka The Bug Man :-)

Re: Encoding Arrays with File Paths

2025-02-20 Thread Bob Sneidar via use-livecode
Thanks Mark I will try that. Good timing too as I was just about to refactor the whole library. :-) Bob S > On Feb 19, 2025, at 8:45 PM, Mark Waddingham via use-livecode > wrote: > > On 2025-02-18 23:18, Bob Sneidar via use-livecode wrote: >> The structure looks like the following: >> I reve

Re: Encoding Arrays with File Paths

2025-02-19 Thread Mark Waddingham via use-livecode
On 2025-02-18 23:18, Bob Sneidar via use-livecode wrote: The structure looks like the following: I reverse the process on the receiving side. It seems to work if I send non-binary data in the [“data”] key but if the data is binary, it fails. I do not think arrayEncode / decode likes to work wi

Re: Encoding Arrays with File Paths

2025-02-19 Thread Monte Goulding via use-livecode
> On 20 Feb 2025, at 12:17 PM, Bob Sneidar via use-livecode > wrote: > > I have narrowed down the issue to the fact that the array I am trying to > arrayDecode has a lot of data in the [n] [“data”] key. Without that data, the > array decodes file. With it I get an error. I even tried base64e

Re: Encoding Arrays with File Paths

2025-02-19 Thread Bob Sneidar via use-livecode
I have narrowed down the issue to the fact that the array I am trying to arrayDecode has a lot of data in the [n] [“data”] key. Without that data, the array decodes file. With it I get an error. I even tried base64encoding it first before putting it in the array key, but that does not seem to he

Re: Encoding Arrays with File Paths

2025-02-19 Thread Bob Sneidar via use-livecode
Hi Monte. I did try your versioning solution but I am still having issues on the receiving end. Given your understanding of what I am trying to do here, how would you “package” the data so that it can be sent over the wire (socket communications)? The idea is to send an array with different key

Re: Encoding Arrays with File Paths

2025-02-18 Thread Bob Sneidar via use-livecode
Ahah! Okay I can do that, but I also determined that if I base64encode the encrypted data before putting it into the [n] [“data”] key then reverse on the other end, it works as well. Same idea, different technique. Bob S > On Feb 18, 2025, at 3:29 PM, Monte Goulding via use-livecode > wro

Re: Encoding Arrays with File Paths

2025-02-18 Thread Monte Goulding via use-livecode
Ah ok so just checked the docs on the array encode version added in LC 7 and found: ``` If present, and >= "7.0" then the array is encoded in such a way as to preserve unicode in keys and values, as well as NUL chars in keys and values ``` So try `arrayEncode(array, “7.0")` > On 19 Feb 2025, at

Re: Encoding Arrays with File Paths

2025-02-18 Thread Bob Sneidar via use-livecode
The structure looks like the following: Sly File Agent API Structure of payload sent [0] [profile] [n] [data] [datemodified] [extpath] [filecategory] [fileid] [filename] [filepath] [operation

Re: Encoding Arrays with File Paths

2025-02-18 Thread Monte Goulding via use-livecode
> On 19 Feb 2025, at 9:39 AM, Bob Sneidar via use-livecode > wrote: > > but one key is the binary file data of a file that has been encrypted using > LC’s built in library. Are you using this as the key or element value? I think keys are always treated as text. It has been quite one time

Re: Encoding Arrays with File Paths

2025-02-18 Thread Bob Sneidar via use-livecode
Thanks Monte. Here is what I am doing: I have a numbered array. Element 0 has a key called operation which simply has a string with one of several possible values. Then I have elements 1 to n with a number of different elements, most are simple strings, but one key is the binary file data o

Re: Encoding Arrays with File Paths

2025-02-18 Thread Bob Sneidar via use-livecode
Okay I don’t think I am having an issue with arrayEncode. I think I am having an issue where arrayEncoding with MacOS is failing to arrayDecode in Windows and vis versa. Bob S > On Feb 18, 2025, at 1:28 PM, Bob Sneidar via use-livecode > wrote: > > Hi all. > > I think I have uncovered an

Re: Encoding Arrays with File Paths

2025-02-18 Thread Monte Goulding via use-livecode
> On 19 Feb 2025, at 9:09 AM, Bob Sneidar via use-livecode > wrote: > > Okay I don’t think I am having an issue with arrayEncode. I think I am having > an issue where arrayEncoding with MacOS is failing to arrayDecode in Windows > and vis versa. The result of arrayEncode is a binary string

Re: Encoding Arrays with File Paths

2025-02-18 Thread Monte Goulding via use-livecode
Hi Bob I strongly suspect a mis-diagnosis here. If you have your paths in an array then do `put arrayDecode(arrayEncode(myArray)) into myArray` do you still see a problem? If you do please report a bug as there is a lot of code that relies on arrayEncode/decode round tripping with no issues. C

Encoding Arrays with File Paths

2025-02-18 Thread Bob Sneidar via use-livecode
Hi all. I think I have uncovered an issue with encoding / decoding arrays where some array elements are file paths. I’m thinking that the forweard slashes are interfering with the decoding process. I think this because the arrayEncoded data has the actual paths still intact in the data stream.