Author Topic: curl::escape(URLnonencoded)  (Read 19759 times)

Script_test

  • Guest
curl::escape(URLnonencoded)
« on: September 07, 2016, 01: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.

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: curl::escape(URLnonencoded)
« Reply #1 on: September 07, 2016, 03:18:20 AM »
Can you post a minimalistic example to test?

Script_test

  • Guest
Re: curl::escape(URLnonencoded)
« Reply #2 on: September 07, 2016, 03: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

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: curl::escape(URLnonencoded)
« Reply #3 on: September 07, 2016, 12: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.
« Last Edit: September 07, 2016, 02:24:26 PM by support »

Script_test

  • Guest
Re: curl::escape(URLnonencoded)
« Reply #4 on: September 08, 2016, 12: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


It is the best way!.It works for me. Thank you very much again! ;D

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: curl::escape(URLnonencoded)
« Reply #5 on: September 08, 2016, 11:19:25 AM »
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!

Script_test

  • Guest
Re: curl::escape(URLnonencoded)
« Reply #6 on: September 14, 2016, 09:58:08 AM »
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!

Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: curl::escape(URLnonencoded)
« Reply #7 on: September 15, 2016, 09:44:19 AM »
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.


Support

  • Administrator
  • *****
  • Posts: 22
    • View Profile
Re: curl::escape(URLnonencoded)
« Reply #8 on: October 16, 2016, 05:26:30 PM »
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.



« Last Edit: October 16, 2016, 05:39:46 PM by support »