Recent

Author Topic: LNet - HttpClient connection problem  (Read 36411 times)

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: LNet - HttpClient connection problem
« Reply #15 on: December 12, 2009, 08:48:35 pm »
Thanks! Now works great. Synapse has always been my favorite sockets and now I can use them even on mobile devices :D

picstart

  • Full Member
  • ***
  • Posts: 236
Re: LNet - HttpClient connection problem
« Reply #16 on: December 13, 2009, 04:39:01 pm »
Synapse is robust. Often developers of open software prefer to push the frontier since that's where the glory is. New features get the kudos. It maybe that for every execution of a new feature there are hundreds of executions of basic function code. A failure in a basic function casts doubt on the creditability of the whole project whereas the absence of a new feature is missed by only a very few. In spite of the fact that only the frontiersmen need advanced features the race goes on and reliability is a lower priority.  Anyway synapse developers have bucked the trend and created a reliable package.

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
Re: LNet - HttpClient connection problem
« Reply #17 on: December 13, 2009, 09:08:12 pm »
@picstart: completely agree. Except "..synapse developers have..". Synapse is a one man show like many great and reliable packages. (see VirtualTrees etc..)

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1933
Re: LNet - HttpClient connection problem
« Reply #18 on: December 28, 2009, 05:36:04 pm »
Thanks! Now works great. Synapse has always been my favorite sockets and now I can use them even on mobile devices :D

Could you show what you have changed in the synapse sources?
I don't need it personally now, but others might be interested.

Thanks.

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: LNet - HttpClient connection problem
« Reply #19 on: December 28, 2009, 07:22:24 pm »
Of course! I copied all files from WinceTools.zip (in the annex if someone couldn't to find) into the synapse directory, replacing the existing ones. In the file synautil I changed directive IFDEF WIN32 to IFDEF WINCE (I did not have time to add OR condition so I use "Replace" function :P ) . And thats all :)

paulvh

  • Newbie
  • Posts: 1
Re: LNet - HttpClient connection problem
« Reply #20 on: May 25, 2010, 08:43:35 am »
I get the same problem ("Error on connect: connection refused") even if I put a slash behind the URL.

Lazarus 0.9.28.2, FPC 2.2.4, lNET SVN, Windows 7

Installed Synapse and with one line of code could fetch a web page, no problem. Of course it is blocking, etc. so it would be nice if lNet can be fixed. The demo, httpclienttest.lpi also dies with "Error creating SSL CTX: SSLCTXNew". If I delete the SSL component it runs, but with connection refused error on any URL.

Firewall is turned off but I expect it has to do with Windows 7.

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: LNet - HttpClient connection problem
« Reply #21 on: May 25, 2010, 11:22:21 am »
@paulvh - this version don't resolve this problem jet?
http://www.lazarus.freepascal.org/index.php/topic,9378.0.html
Quote
URL parsing rewrite (pesky trailing "/" no longer a problem Cheesy)

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: LNet - HttpClient connection problem
« Reply #22 on: May 27, 2010, 11:28:49 am »
paulvh: Connection refused is only used when recv returns 0 which means the OS says so. Perhaps it's a windows 7 thing, but I don't own nor do I plan to own a windows 7 so I can't debug this. Your SSL problem could be due to OpenSSL libs. What version did you install?

Loesje

  • Full Member
  • ***
  • Posts: 168
    • Lazarus Support website
Re: LNet - HttpClient connection problem
« Reply #23 on: September 02, 2010, 08:48:32 pm »
I have the same problem as paulvh on Linux (FC11) - latest fpc-lnet svn, fpc-trunk (2.5.1) and Lazarus (2.9.29)

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: LNet - HttpClient connection problem
« Reply #24 on: March 02, 2011, 09:32:47 pm »
There were two bugs in DecomposeURL:

1. The result value should be true only if it's a https
2. The port should default to 80 for http, 443 for https (was only 80 all the time, caused the SSL error)
3. [optiona] fixed error reporting from SSL (reported rubbish before) and also added whole-error-stack SSL reports to get through.

Both bugs were related to me changing the DecomposeURL code to use ParseURI from FPC and not properly handling these situations in the new setting. Fixed now in trunk.

Thank you for reporting the issue :)
« Last Edit: March 02, 2011, 10:18:12 pm by Almindor2 »

Dibo

  • Hero Member
  • *****
  • Posts: 1057
Re: LNet - HttpClient connection problem
« Reply #25 on: March 02, 2011, 10:26:03 pm »
@Up. Exactly. I wrote my own DecomposeURL. Another bug is that DecomposeURL cut variables in links. Example: "www.someweb.com/srcipt.php?var1=value1&var2=value2" return ""www.someweb.com/srcipt.php" (or something that, I am not in my computer)

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: LNet - HttpClient connection problem
« Reply #26 on: March 02, 2011, 10:28:01 pm »
Fixed as well, am using the TURI.Params now if they are present.

I will probably use TURI internally eventually in HTTP to evade these problems.
« Last Edit: March 02, 2011, 10:42:01 pm by Almindor2 »

Shebuka

  • Sr. Member
  • ****
  • Posts: 429
Re: LNet - HttpClient connection problem
« Reply #27 on: June 08, 2011, 05:25:59 pm »
Hi, I think i'v found a bug in new version, if URL has white spaces (like http://my.server.com/folder/some file of mine.txt) it is not encoded on SendRequest so it produce 400 Bad Request error even if file exists.
(and if i manually replace spaces with %20 they are decoded internally in URLparser so again produce 400 Bad Request error, in 0.6.4 with old DecomposeURL it was working well)

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
Re: LNet - HttpClient connection problem
« Reply #28 on: June 12, 2011, 09:27:58 am »
Fixed in trunk, thanks

 

TinyPortal © 2005-2018