packing arrays to send to server on-rev issues

Are you using LiveCode to create server scripts or CGIs?

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
fenick
Posts: 15
Joined: Fri Mar 20, 2009 10:32 pm

packing arrays to send to server on-rev issues

Post by fenick » Wed Jun 26, 2013 6:59 pm

When I ran this on my local server:

function unPackArray pData, returnMe
local tError
try
put arrayDecode( URLdecode(pData) ) into pData
if pData = empty then
get doError ("error.10.no data received on server side.", returnMe)
else
return pData
end if
catch tError
get doError ("error.20.could not unpack on server side.", returnMe)
end try
end unPackArray

it unpacks the array and works nicely.

When I run this script when it is on on-rev. pData end up being empty and it returns my error message.

Since it is the same script, but performsn different, I thought someone on this board might have an idea of where else to dig.

-Nick

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5147
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: packing arrays to send to server on-rev issues

Post by Mark » Fri Jun 28, 2013 9:41 am

Hi Nick,

What is the version of revServer? Perhaps it doesn't contain a routine for arrayEncode/arrayDecode. It would help if you returned tError instead of your own custom error. What does tError contain? Recently, I also read about someone who was unable to use arrays larger than 8MB.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

fenick
Posts: 15
Joined: Fri Mar 20, 2009 10:32 pm

Re: packing arrays to send to server on-rev issues

Post by fenick » Fri Jun 28, 2013 4:50 pm

This happens on on-rev hosting. I do not know how to look up which version of the server they are using. Any ideas?

The try does not fail, do it never falls into the catch to set a tError

I Want to see what happens after put URLdecode(pData) into pData.... but I can't since it is reverted to non safe characters and gets messed up on the response from the server.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8421
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: packing arrays to send to server on-rev issues

Post by FourthWorld » Fri Jun 28, 2013 5:04 pm

Instead of urlencode, try base64encode.
Richard Gaskin
LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5147
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: packing arrays to send to server on-rev issues

Post by Mark » Thu Jul 04, 2013 11:49 am

Hi Fenick,

I think that the version function should return the version of the LC server engine.

I see two possibilities. Either no data is sent to the On-Rev server and pData is actually empty, or the version of LC server on your On-Rev server doesn't recognise that an array is not an empty variable. Try

Code: Select all

pData is an array
instead. If it returns false, then something is wrong with pData and we'll have to look into that.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply

Return to “CGIs and the Server”