Bitcoin Forum
December 12, 2024, 02:46:26 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin JSON RPC Connection gets reset by client...  (Read 1922 times)
Chick (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
July 04, 2011, 12:19:37 AM
Last edit: July 04, 2011, 02:22:51 AM by Chick
 #1

Occasionally, PHP returns an error similar to this: "ErrorException [ Warning ]: fgets(): SSL: Connection reset by peer" when sending api commands to the bitcoin server. What can I do to resolve this issue?

Chick (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
July 04, 2011, 04:03:35 AM
 #2

Bump.

JoelKatz
Legendary
*
Offline Offline

Activity: 1596
Merit: 1012


Democracy is vulnerable to a 51% attack.


View Profile WWW
July 04, 2011, 04:30:01 AM
 #3

This is legal behavior, and if it confuses some other code, that code is broken. See section 8.1.4.4 of the HTTP 1.1 specification: "A client, server, or proxy MAY close the transport connection at any time. ... This means that clients, servers, and proxies MUST be able to recover from asynchronous close events."

That said, the bitcoin client hopelessly bungles persistent and concurrent connections. A fix for this is one of the fixes in my '3diff' patch set. http://davids.webmaster.com/~davids/bitcoin-3diff.txt

I am an employee of Ripple. Follow me on Twitter @JoelKatz
1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
Chick (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
July 04, 2011, 05:29:19 AM
Last edit: July 05, 2011, 06:33:35 AM by Chick
 #4

This is legal behavior, and if it confuses some other code, that code is broken. See section 8.1.4.4 of the HTTP 1.1 specification: "A client, server, or proxy MAY close the transport connection at any time. ... This means that clients, servers, and proxies MUST be able to recover from asynchronous close events."

That said, the bitcoin client hopelessly bungles persistent and concurrent connections. A fix for this is one of the fixes in my '3diff' patch set. http://davids.webmaster.com/~davids/bitcoin-3diff.txt


Thanks for clearing that up! The code isn't broken, but it's just a warning. It shouldn't interfere with anything in production.

JoelKatz
Legendary
*
Offline Offline

Activity: 1596
Merit: 1012


Democracy is vulnerable to a 51% attack.


View Profile WWW
July 04, 2011, 05:35:58 AM
 #5

Well, the code is broken, it mishandles persistent connections. But its breakage is manifesting in a way that is permitted by the standard. So if it affects other code, that code is broken too. Smiley

Thanks.

I am an employee of Ripple. Follow me on Twitter @JoelKatz
1Joe1Katzci1rFcsr9HH7SLuHVnDy2aihZ BM-NBM3FRExVJSJJamV9ccgyWvQfratUHgN
Chick (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
July 04, 2011, 05:44:45 AM
 #6

Well, the code is broken, it mishandles persistent connections. But its breakage is manifesting in a way that is permitted by the standard. So if it affects other code, that code is broken too. Smiley

Thanks.


Well, in that case, PHP is broken. Tongue

I think I'll be adding in your patch and recompiling the code.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!