Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Elemar
Beginner


Joined: 04 Jan 2001
Posts: 14

PostPosted: Sun Sep 01, 2002 8:51 pm   

Odd #URL behaviour...
 
Oky... I'm having a problem with the #URL commmand.

I have a web-based database I'm updating via script from within Zmud. Basically, I build a variable @urloutput with data, and then send it to a script on a webserver.

My @urloutput variable looks something like this :

http://cgibin.rcn.com/steve.lawrence/cgi-bin/env.cgi?Newark|100|200|300|400|500|600|700|800|900

and so on.. I use '#URL @urloutput' to send it to my webserver, and it catches the arguments correctly and all's fine.

The variable is in fact, alot longer than that. Somewhere betweeen 400 and 500 characters. And the above supplied url takes you to a perl script that simply spits out the environment variables passed to it - the QUERY_STRING is the arguments supplied by the url.

If you paste the above into a browser window you'll see the Newark|100|200 etc reported as the arguments.

It works fine. But when I populate it with actual data as shown by the variable below :

http://cgibin.rcn.com/steve.lawrence/cgi-bin/env.cgi?Newark|800|1700|1000|800|1678|5784|11574|20256|200|4820|80|120|110|80|60|34650|9234|11540|7700|3336|12288|9562|11942|6828|10240|81224|70308|53760|30720|69108|770|570|210|60|30|38016|21504|26880|13440|5760|15744|1924|5776|4548|12250|58000|150|600|5800|2200|9136|3426|3426|240|152|952|760|43668|2512|12130|6756|18720|18132|11484|14098|12090|10480|19228|17488|11214|19376|28842|5252|7720|16220|20080|12972|6264|3712|5568|200|27860|1790|620|110|908|290

it shows some.. interesting results.

If you close your browser window, and type the following into a Zmud command line (all one line):

#URL http://cgibin.rcn.com/steve.lawrence/cgi-bin/env.cgi?Newark|800|1700|1000|800|1678|5784|11574|20256|200|4820|80|120|110|80|60|34650|9234|11540|7700|3336|12288|9562|11942|6828|10240|81224|70308|53760|30720|69108|770|570|210|60|30|38016|21504|26880|13440|5760|15744|1924|5776|4548|12250|58000|150|600|5800|2200|9136|3426|3426|240|152|952|760|43668|2512|12130|6756|18720|18132|11484|14098|12090|10480|19228|17488|11214|19376|28842|5252|7720|16220|20080|12972|6264|3712|5568|200|27860|1790|620|110|908|290

It *correctly* fires up a browser window, passes the arguments to Exploder / Mozilla / Netscape / Your browser of choice.

However, if you keep your browser window open, and do it again... Nothing. It sits there all limp and lifeless. I've since determined that Zmud appears to be limiting the string length allowed for the #URl. As far as I can tell around 200 characters is the max. If your url is larger than that it never passes it. The following command is 241 characters long, and without the #URL(space) is 236 characters long :

#URL http://cgibin.rcn.com/steve.lawrence/cgi-bin/env.cgi?Newark|1|2|3|4|5|6|7|8|9|10|9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999|146|123456789|123456789|123456789|abcdefg

The output is correct. The URL is sent and it works. If you add an 'h' to the end, thusly

#url http://cgibin.rcn.com/steve.lawrence/cgi-bin/env.cgi?Newark|1|2|3|4|5|6|7|8|9|10|9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999|146|123456789|123456789|123456789|abcdefgh

It fails. It never passes the string, and the browser doesn't recieve the URL. I can't really see any 'magic number' here. 256 I could give credence to, but it's substantially less than that. The arguments themselves (without the url preceder) come to 185 characters - Again, not a very magic number.

What gives?

Why does this work if my browser is closed initially, but not work if it's called when my browser is open.
Why is there a restriction on the length of a URL I can pass, and how can I get around it?
If this restriction is in place due to an arbitrary coding decision, could you consider removing it or substantially increasing the limitation.

Thanks for your time / patience / help,
Steve.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Sep 08, 2002 4:15 pm   
 
I haven't the slightest idea of how the #URL command is programmed, so I can't tell you what its limits are, why it works differently depending on whether the browser is open or closed, or why particular string lengths should be its limits. However, I think you'd be better off investigating alternative methods of sending the information to your database rather than trying to figure out the technical details of zMUD. You might also consider using the built-in zMUD database.

LightBulb
Senior Member
Reply with quote
Elemar
Beginner


Joined: 04 Jan 2001
Posts: 14

PostPosted: Sun Sep 15, 2002 10:57 am   
 
How do Mr Bulb,

Addressing your reply in reverse order :

>You might also consider using the built-in zMUD database.

That really isn't a possibility. The database has to be accessible across a network, and really doesn't have anything to do with Zmud. Zmud just happens to be the scripting telnet-like-application I chose to get the job done.

>I think you'd be better off investigating alternative methods of sending the information >to your database rather than trying to figure out the technical details of zMUD.

This sounds suspiciously like 'Go away.'.
Which is fair enough. Far be it for me to expect a program to behave in a consistent, documented manner.

>I haven't the slightest idea of how the #URL command is programmed

It would have been nice, however, to have had perhaps one person report on wether its *my* problem - I don't rule this out - or that the behaviour outlined above is universal. That someone could follow the steps and say 'It works for me..' or 'It doesn't' would be helpful.

>LightBulb
Elemar.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Sep 15, 2002 2:47 pm   
 
Hi Elemar. I'm sorry my first reply wasn't very helpful. I knew it wouldn't be, which
is why I waited most of a week before responding.

I don't like to see questions go unanswered, but I had hoped someone more knowledgeable
about what you were doing might choose to answer. Since nobody did, I gave you the
best answer I had.

Of course you should expect a program in a consistent, documented manner. However, I am
not an employee of Zugg Software, or even a representative (guru) thereof, just another
interested (and somewhat knowledgeable) user. Technical information on the length of
parameters to particular commands is probably only available from Zugg himself.
If you send him a polite email he might respond. However he is quite busy, as he and
his wife are the only "employees" and he is the sole programmer for the company and is
working on several programs.

By "investigating alternatative methods", I did not mean "go away". I meant you might
look into the possibility of writing to a file and sending it to the website through
email, AIM, FTP, or some other method. You might create a zMUD database, export it, and
import it to your website. You might try other things that won't even occur to me.
There must be more than ONE way to get data to your website...if one method (#URL) is
unsatisfactory try others.

I regret that you probably won't find this reply any more useful than my first one, but
it's the best I have. You needn't bother to go through it point by point, explaining why
it's unsatisfactory.

LightBulb
Senior Member
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Sep 15, 2002 5:30 pm   
 
After tweaking around a bit I think I have a solution.

The help files for #URL indicate that is uses a DDE call, and that it detects what application to address that call to by the .htm file association.

Further examination of the help files for #DDE shows a nice example of opening a url with Netscape.

Now this is the guess on my part; zMud seems to try converting "#URL http://cgibin.rcn.com/steve.lawrence/cgi-bin/env.cgi?Newark|1|2|3|4|5|6|7|8|9|10|9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999|146|123456789|123456789|123456789|abcdefgh" into "#DDE iexplore www_openurl http://cgibin.rcn.com/steve.lawrence/cgi-bin/env.cgi?Newark|1|2|3|4|5|6|7|8|9|10|9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999|146|123456789|123456789|123456789|abcdefgh". Now if you look at the aurguments for the #DDE its length is 257. Another guess is that the string space in memory that zMud is using for that conversion is limited to the expected 256, and the final argument doesn't fit so in order to avoid memory corruption it does not get tacked on.

So the final answer is do the conversion yourself.
#DDE iexplore www_openurl http://cgibin.rcn.com/steve.lawrence/cgi-bin/env.cgi?Newark|1|2|3|4|5|6|7|8|9|10|9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999|146|123456789|123456789|123456789|abcdefgh

If you want to uses a different browser you can find the name of the DDE server by looking at the htm file type.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net