mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 3,969
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,969
Originally found by entropy, after a quick debug with the team, it appears that this code does not work on windows 7 or below (windows xp tested by Kindone) but works on windows 10, so it seems to be related to some windows api function being used which don't work correctly on windows 7 and below, but difficult to say from our point of view. Using normal /sockopen socket to try to reach that server works on windows 7 and xp.

Type /dosynapi for the $urlget test

Code
alias dosynapi noop $urlget(https://www.merriam-webster.com/thesaurus/test,gbi,&dosyn,processsynapi)
alias processsynapi echo -sg > id: $1 -- state: $urlget($1).state

Vs

Type /socktest for Classic socket test
Code
alias socktest {
  sockclose s
  sockopen -e s www.merriam-webster.com 443
  ;https://www.merriam-webster.com/thesaurus/test
}

on *:sockopen:s:{
  ;these headers are what $urlget sends by default
  sockwrite -n s GET /thesaurus/test HTTP/1.1
  sockwrite -n s Accept: */*
  sockwrite -n s Accept-Encoding: gzip, deflate
  sockwrite -n s User-Agent: mIRC
  sockwrite -n s Host: www.merriam-webster.com:443
  sockwrite -n s Connection: Keep-Alive
  sockwrite -n s Cache-Control: no-cache
  sockwrite -n s
}

on *:sockread:s:{
  var %a
  sockread %a
  if (!$sockbr) return
  echo -sg > %a
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,244
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,244
Thanks for your bug report. The reason for this is that Windows XP and 7 are no longer being updated by Microsoft. This means that all of their APIs, including those related to WinINet, which mIRC uses for $urlget(), are not receiving updates to handle new technologies. In the case of WinINet, it is trying to connect to an SSL server that is not allowing old/insecure ciphers. There is little an application can do to get around this with older versions of Windows, other than implementing features without using Windows APIs.

Joined: Jan 2004
Posts: 1,994
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,994
Can you explain further about

/help $urlget
Quote
If the call fails, for any reason, it returns an id of zero.

The script was relying on (id > 0) == success, yet it knew there was a failure because $urlget().state was returning 'fail'. Is it intended that some fails make id=0 and others don't?

Joined: Dec 2002
Posts: 5,244
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,244
Quote
Can you explain further about
$urlget() is a threaded call. If you initiate a $urlget() and there is an immediate error, it will return 0.

In the above example, $urlget() succeeds because it was initiated succesfully.

However, it can still fail during the connection process, which involves blocking calls, for any number of reasons. That is why there is a .state property that allows you to check if the connection failed.

Joined: Jul 2014
Posts: 285
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2014
Posts: 285
I'm going to give my opinion and I don't want it to be interpreted as a criticism, but I think it's time for mIRC to review the minimum requirements for use. I think that everything has its evolution and a lot of technology starts to become obsolete due to the lack of evolution of Windows, so I think that Windows XP/Vista and 7 should be dropped from new and future versions of mIRC, so that the evolution of programming can continue on mIRC, because the Khlaed, no matter how hard he tries, will never be able to solve certain problems due to the lack of Windows updates that Microsoft has stopped supporting.


TECO
irc.PTirc.org (Co-Admin)
Joined: Nov 2004
Posts: 831
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 831
I like the fact that mIRC works on Windows XP, though...


What do you do at the end of the world? Are you busy? Will you save us?
Joined: Dec 2002
Posts: 1,535
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,535
long time idle with posting here, but I can agree with this, even as one using an outdated OS. As I recall, 6.0 was the first version to NOT support operating systems before XP (because of multi server connections) and 5.91 was the last version for Win9x and probably ME and NT. Somebody PLEASE correct me if Im wrong, BUT, the point is, there is a natural evolution and at some point, you HAVE to stop supporting an older OS so that progress can be made. I LOVE how hard Khaled is trying to have his program work for people with older OSes; it is commendable. keep in mind, I am highlighting my opinion simply as a timeline respect and NOT with respect to program coding (as I know jack about it).


Those who fail history are doomed to repeat it
Joined: Jul 2006
Posts: 3,969
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,969
Quote
There is little an application can do to get around this with older versions of Windows, other than implementing features without using Windows APIs.
Well it's not great to have $urlget behaving differently than normal socket when it comes to things we, as scripters, have no control over, here SSL and ciphers.
Is it not possible to force a different cipher list with the wininet api?

When it comes to http and non persistent connection (btw Connection: keep-alive is sent as header which does not make sense), $urlget is now a must, but this issue changes the game.

It's possible to script $urlget with normal socket but that defeats the purpose of it and it's much slower, is there no plan to get rid of the windows api?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard