ScriptBasic

Support => General Discussions => Topic started by: Script_test on September 07, 2016, 08:32:44 am

Title: curl::escape(URLnonencoded)
Post by: Script_test on September 07, 2016, 08:32:44 am
Hello again, I'm trying to use to encode url.
Code: [Select]
url = curl::escape(URLnonencoded)
but from windows get stuck the script. It works correctly from linux ?
Thanks.
Title: Re: curl::escape(URLnonencoded)
Post by: Support on September 07, 2016, 10:18:20 am
Can you post a minimalistic example to test?
Title: Re: curl::escape(URLnonencoded)
Post by: Script_test on September 07, 2016, 10:47:55 am
Code: [Select]
Import "c:\scriptbasic\include\curl.bas"

url = curl::escape("http://www.scriptbasic.org/forum/index.php/topic,342.0.html")

print url
end
Title: Re: curl::escape(URLnonencoded)
Post by: Support on September 07, 2016, 07:37:05 pm
Works fine on Linux.

Code: Script BASIC
  1. Import curl.bas
  2.  
  3. url = curl::escape("http://www.scriptbasic.org/forum/index.php/topic,342.0.html")
  4.  
  5. print url,"\n"
  6.  


jrs@laptop:~/sb/sb22/test$ scriba curl_esc.sb
http%3A%2F%2Fwww.scriptbasic.org%2Fforum%2Findex.php%2Ftopic%2C342.0.html
jrs@laptop:~/sb/sb22/test$


Under Windows 7 32 bit it crashes scriba with a Windows exception.  ::)

Can you try it with the command line version of cURL and see if you get the same results?

I took a quick peek at the cURL extension module code and it seems the escape/unescape  routines use free() while others use besFREE(). The free() should only be used if Script BASIC isn't using it's MyAlloc thread safe memory manager and using a single threaded model and alloc(). The escape stuff must have been added later by someone else. (All theory at this point.) Why it works in Linux, I don't have a clue.
Title: Re: curl::escape(URLnonencoded)
Post by: Script_test on September 08, 2016, 07:11:20 am
Quote
Can you try it with the command line version of cURL

Code: [Select]
EXECUTE("curl -S -L -D .............", time_out,pid_v) http://files.allbasic.info/ScriptBasic/commands.html#command_EXECUTE (http://files.allbasic.info/ScriptBasic/commands.html#command_EXECUTE)


It is the best way!.It works for me. Thank you very much again! ;D
Title: Re: curl::escape(URLnonencoded)
Post by: Support on September 08, 2016, 06:19:25 pm
I'm glad you were able to find a workaround until I have time to fix the Script BASIC cURL extension module. I'll post a new Windows 32 version once I get it working. Thanks for the heads-up and testing!
Title: Re: curl::escape(URLnonencoded)
Post by: Script_test on September 14, 2016, 04:58:08 pm
Quote
I'm glad you were able to find a workaround until I have time to fix the Script BASIC cURL extension module. I'll post a new Windows 32 version once I get it working. Thanks for the heads-up and testing!

Waiting for this new version. Thank you so much!
Title: Re: curl::escape(URLnonencoded)
Post by: Support on September 15, 2016, 04:44:19 pm
I tried to compile a new curl.dll extension module for Windows last night and it complained looking for the dependency curllib.dll instead of libcurl.dll. Why and where the screw up is I don't know at the moment. I'll keep chipping away at it as I have time.

Title: Re: curl::escape(URLnonencoded)
Post by: Support on October 17, 2016, 12:26:30 am
I have been working on building a TDM-GCC32 version of Script BASIC for Windows 32 and once again the cURL extension module is being dependent/reference elusive. What you have works with HTTPS: (with the discovery of LIBCURL.DLL I found) which is an old VC9 compiled version with SSL support. The current version of cURL .a resources complain with missing references I'm unable t resolve at this time. I was able to compile a nossl version which seems to solve your curl::escape() issue. The attached zip contains the Script BASIC curl.dll extension module and doesn't seem to require the libcurl.dll or curl.dll resources to run. I hope to revisit this when I have more time to get a SSL/SSH version of cURL working on 32 bit Windows.