Con Kolivas
|
c9b4f5c757
|
Revert "Cope with out of order messages coming in upon attempting to auth_stratum."
This reverts commit 237f67c617 .
|
2013-03-07 15:34:44 +11:00 |
|
Con Kolivas
|
ed903ddf31
|
Clear just the socket buffer when we don't care what is left in a stratum socket.
|
2013-03-07 15:13:32 +11:00 |
|
Con Kolivas
|
fbb25c4ba5
|
Clear the stratum socket whenever we are closing it since the buffer is going to be reused.
|
2013-03-07 15:10:38 +11:00 |
|
Con Kolivas
|
0810212c9a
|
Reset stratum_notify flag on suspend_stratum as well.
|
2013-03-07 14:20:33 +11:00 |
|
Con Kolivas
|
07ae6172cc
|
Close any sockets opened if we fail to initiate stratum but have opened the socket.
|
2013-03-07 14:15:28 +11:00 |
|
Con Kolivas
|
6875dc46b6
|
Close any existing stratum socket if we are attempting to restart stratum so the pool knows the connection has gone.
|
2013-03-07 13:50:25 +11:00 |
|
Con Kolivas
|
237f67c617
|
Cope with out of order messages coming in upon attempting to auth_stratum.
|
2013-03-07 11:36:04 +11:00 |
|
Con Kolivas
|
e3151799b6
|
Implement client.show_message support for stratum.
|
2013-03-07 08:42:14 +11:00 |
|
Con Kolivas
|
0be6e9e76c
|
Make sure to retry only once with noresume support for stratum.
|
2013-03-06 21:01:46 +11:00 |
|
Con Kolivas
|
5abcf06bbe
|
Merge branch 'master' into usb-dev
|
2013-02-25 10:44:54 +11:00 |
|
Con Kolivas
|
3c949e5f6c
|
Try to extract the sessionid associated with mining.notify on 3rd level array and submit it along with the userid to support mining resume, failing gracefully and restarting if the pool rejects it.
|
2013-02-25 10:43:48 +11:00 |
|
Con Kolivas
|
5a3b374962
|
Update copyright dates.
|
2013-02-25 08:59:11 +11:00 |
|
Con Kolivas
|
6bf79626b8
|
Merge branch 'master' into usb-dev
|
2013-02-23 13:59:37 +11:00 |
|
Con Kolivas
|
3dcdb94921
|
Cope with misread sessionid on stratum for now.
|
2013-02-23 13:07:47 +11:00 |
|
ckolivas
|
6a0882f05b
|
Use the sessionid as passed on stratum connect to attempt to resume a connection once and then clear it if it fails, to use a new connection.
|
2013-02-22 16:55:39 +11:00 |
|
ckolivas
|
68d691093c
|
Move to storing the nonce1 in the work struct instead of the sessionid for the now defunct first draft mining.resume protocol.
|
2013-02-22 12:55:01 +11:00 |
|
ckolivas
|
22a50a5a0f
|
Merge branch 'usb-dev' of github.com:ckolivas/cgminer into usb-dev
|
2013-02-17 00:10:36 +11:00 |
|
Con Kolivas
|
a7859bb416
|
Merge pull request #386 from luke-jr/bugfix_20130215a
Bugfix: Missing pool_no parameter to applog for no-stratum-sessionid debug message
|
2013-02-16 03:52:06 -08:00 |
|
Luke Dashjr
|
7473c3dc94
|
Bugfix: Missing pool_no parameter to applog for no-stratum-sessionid debug message
|
2013-02-16 05:06:38 +00:00 |
|
Con Kolivas
|
ab0cc58cb4
|
Merge branch 'master' into usb-dev
|
2013-02-15 23:15:11 +11:00 |
|
Con Kolivas
|
be4705a003
|
Provide support for mining.resume with stratum, currently re-authorising after successful resumption pending finalising of the protocol process.
|
2013-02-15 23:05:29 +11:00 |
|
Con Kolivas
|
4cde791e9f
|
Provide basic framework for restarting stratum depending on whether resume support exists or not.
|
2013-02-15 21:31:44 +11:00 |
|
Con Kolivas
|
c29df9760f
|
Abstract out the setting up of the stratum curl socket.
|
2013-02-15 21:03:39 +11:00 |
|
Con Kolivas
|
c851f39598
|
Store session id for stratum if the pool supports it for future mining.resume support.
|
2013-02-15 14:46:30 +11:00 |
|
Kano
|
c432c655f7
|
debug_cb buffer type warning
|
2013-02-13 14:50:55 +11:00 |
|
Con Kolivas
|
3c91b292a2
|
Merge branch 'master' into usb-dev
|
2013-02-07 18:02:38 +11:00 |
|
Con Kolivas
|
903c666326
|
Fix logic fail on partial writes with stratum send that was leading to corrupt message submissions.
|
2013-02-07 16:38:11 +11:00 |
|
Con Kolivas
|
0244998ef8
|
Merge branch 'master' into usb-dev
|
2013-02-04 11:23:20 +11:00 |
|
Con Kolivas
|
d644fdf1f4
|
Cache the coinbase length to speed up stratum work generation.
|
2013-02-04 11:19:12 +11:00 |
|
Con Kolivas
|
0870ab7532
|
Cache the header length when generating stratum work to avoid calculating it on every work generation, and to only need one alloc+sprintf, speeding up work generation.
|
2013-02-04 11:06:05 +11:00 |
|
Con Kolivas
|
51d11a28f9
|
Provide a wrapper for aligning lengths of size_t to 4 byte boundaries.
|
2013-02-04 10:19:12 +11:00 |
|
Kano
|
c1eae36f7b
|
API stats - include pool network bytes + in miner.php
|
2013-02-02 20:14:33 +11:00 |
|
Con Kolivas
|
e1387dc85c
|
Change the pool stratum socket buffer to be dynamically allocated to accomodate any size coinbase and keep receiving data in recv line for up to 60s if no end of line has been received.
|
2012-12-29 11:29:59 +11:00 |
|
Con Kolivas
|
6e2e7d36de
|
Differentiate socket full from sock full.
|
2012-12-29 10:46:55 +11:00 |
|
Con Kolivas
|
7f46f6e91f
|
Allow stratum to startup without notify but check it is valid before creating stratum work.
|
2012-12-29 10:42:45 +11:00 |
|
Con Kolivas
|
e1d7ecdd35
|
Do not try to generate stratum work unless the notify command has succeeded.
|
2012-12-29 09:45:40 +11:00 |
|
Con Kolivas
|
944af31b99
|
Parse anything in the stratum socket if it's full without waiting. Empty the socket even if a connection is not needed in case there are share returns.
|
2012-12-26 09:31:41 +11:00 |
|
Con Kolivas
|
cada0d3195
|
Check for EWOULDBLOCK when supported in send and recv as well.
|
2012-12-14 21:36:42 +11:00 |
|
Con Kolivas
|
2274af6a05
|
Use the raw send() command instead of curl_easy_send since curl raw socket usage introduces random bugs on windows.
|
2012-12-14 21:29:33 +11:00 |
|
Con Kolivas
|
f66d59df03
|
Use raw recv() command in place of curl_easy_recv since the curl implementation introduces random bugs on windows builds when the recv fails.
|
2012-12-14 21:20:52 +11:00 |
|
Kano
|
138465bf0c
|
Pool store data transfer stats
|
2012-12-13 00:56:10 +11:00 |
|
Con Kolivas
|
ac3020f45b
|
Include prctl header for thread renaming to work.
|
2012-12-10 22:02:31 +11:00 |
|
Con Kolivas
|
15e5e36bcd
|
Return value of keep_sockalive is no longer used.
|
2012-12-09 14:13:24 +11:00 |
|
Con Kolivas
|
8fcc67f308
|
Remove dependency on mstcpip.h for windows build by making curl version >= 7.25.0 mandatory on windows builds, and use curl functions for keepalive whenever possible instead.
|
2012-12-09 13:39:37 +11:00 |
|
Con Kolivas
|
68f1b2c4b5
|
Set successful connect to true on auth stratum to allow summary on exit from single stratum pool.
|
2012-12-08 22:14:47 +11:00 |
|
Con Kolivas
|
be013e9699
|
Set pool probed to true on successful authorisation with stratum to avoid it being pinged later with pool_getswork.
|
2012-12-07 09:37:37 +11:00 |
|
Con Kolivas
|
fc5d3a0eaf
|
Suspend stratum connections to backup pools when there is no requirement to potentially grab work from them.
|
2012-12-03 09:52:46 +11:00 |
|
Denis Ahrens
|
271b05ab04
|
setting the name of the threads for linux,freebsd,openbsd and osx
code is borrowed from bitcoins util.c, so it is already tested
|
2012-12-02 11:39:20 +01:00 |
|
Con Kolivas
|
fc66a41e85
|
Style police.
|
2012-12-02 20:49:40 +11:00 |
|
Con Kolivas
|
f94cff77e6
|
Microoptimise and remove redundant copy of strdup function in calloc_strcat.
|
2012-12-02 18:06:55 +11:00 |
|
Con Kolivas
|
0ae02c6ec4
|
Since we will be using calloc_str to put a string into it, convert the function to calloc_strcat which does it automatically.
|
2012-12-01 08:26:31 +11:00 |
|
Con Kolivas
|
ee8609d9a9
|
Provide helper functions calloc_str and realloc_strcat to create and extend arbitrary length arrays based on string length.
|
2012-11-29 12:48:17 +11:00 |
|
nelisky
|
6db7e2e5cf
|
fixes target calc for mips openwrt
|
2012-11-24 13:12:19 -08:00 |
|
Con Kolivas
|
0b088d8d81
|
Provide rudimentary support for literal ipv6 addresses when parsing stratum URLs.
|
2012-11-18 18:08:14 +11:00 |
|
Con Kolivas
|
f14bf5b16c
|
Merge pull request #326 from pshep/error_counters
Error counters
|
2012-11-17 22:06:49 -08:00 |
|
Con Kolivas
|
b3864d1a94
|
Support for fractional diffs and the classic just-below-1 share all FFs diff target.
|
2012-11-15 09:18:58 +11:00 |
|
Paul Sheppard
|
dad6c70420
|
Merge branch 'master' into error_counters
|
2012-11-06 09:46:05 -08:00 |
|
Con Kolivas
|
cc7c274543
|
Manage appropriate response codes for share submission with GBT.
|
2012-11-05 16:28:52 +11:00 |
|
Paul Sheppard
|
84173c6cc7
|
missing a break.
|
2012-11-04 20:38:11 -08:00 |
|
Paul Sheppard
|
9f74e650b3
|
Tidy up device error counts
|
2012-11-04 20:17:43 -08:00 |
|
Luke Dashjr
|
c2b5c5ee4c
|
Bugfix: Free old stratum_work data before replacing it
|
2012-10-30 19:30:11 +11:00 |
|
Con Kolivas
|
c2861d683a
|
There is no need for addrinfo any more.
|
2012-10-30 19:22:02 +11:00 |
|
ckolivas
|
a2d5783509
|
server and client sockaddr_in are no longer used in struct pool.
|
2012-10-30 16:45:27 +11:00 |
|
Con Kolivas
|
48f24223b8
|
Shorten the initiate stratum connect timeout to 30 seconds.
|
2012-10-29 12:35:21 +11:00 |
|
Con Kolivas
|
6f4c47ebd2
|
Make stratum socket fail more robust on windows by disabling the send buffer.
Reuse the same curl handle forcing a new connection instead of risking derefencing.
Add information about submission failure to stratum send.
|
2012-10-29 12:08:10 +11:00 |
|
Con Kolivas
|
aa97e87a13
|
Use keepalive with stratum sockets to improve its ability to detect broken connections.
|
2012-10-28 09:15:45 +11:00 |
|
Con Kolivas
|
d9276557f1
|
Show only the URL in the status bar to avoid long prefixes making for extra long lines.
|
2012-10-27 23:20:10 +11:00 |
|
Con Kolivas
|
6d3c880a25
|
Make sure to check pool stratum curl exists under lock before attempting any recv to not risk dereferencing upon attempting to reinitiate stratum.
|
2012-10-22 22:48:12 +11:00 |
|
Con Kolivas
|
e575763a80
|
Avoid redefining macros and align to 4 byte boundaries.
|
2012-10-22 22:06:00 +11:00 |
|
ckolivas
|
bb4bec98d5
|
Use select on stratum send to make sure the socket is writeable.
|
2012-10-17 09:34:32 +11:00 |
|
Con Kolivas
|
99adf397bd
|
Failure to calloc in bin2hex is a fatal failure always so just check for that failure within the function and abort, simplifying the rest of the code.
|
2012-10-16 19:47:31 +11:00 |
|
Con Kolivas
|
b3d4258940
|
Provide locking around the change of the stratum curl structures to avoid possible races.
|
2012-10-16 19:22:48 +11:00 |
|
Con Kolivas
|
e5babfa25b
|
Watch for buffer overflows on receiving data into the socket buffer.
|
2012-10-15 11:40:32 +11:00 |
|
Con Kolivas
|
2a9b3e33d3
|
String alignment to 4 byte boundaries and optimisations for bin<->hex conversions.
|
2012-10-14 09:54:04 +11:00 |
|
Con Kolivas
|
fc72ad5563
|
Off by one error.
|
2012-10-12 14:57:42 +11:00 |
|
Con Kolivas
|
9ccfcee6dc
|
Prevent overflows of the port char array in extract_sockaddr.
|
2012-10-12 14:55:52 +11:00 |
|
ckolivas
|
7f522ef83c
|
Add support for client.get_version for stratum.
|
2012-10-11 14:23:09 +11:00 |
|
Con Kolivas
|
a533f106fd
|
Update reconnect message to show whole address including port.
|
2012-10-11 00:08:45 +11:00 |
|
Con Kolivas
|
5226a399c7
|
Look for null values and parse correct separate array entries for url and port with client reconnect commands for stratum.
|
2012-10-11 00:06:44 +11:00 |
|
Con Kolivas
|
7c04a00e62
|
The command for stratum is client.reconnect, not mining.reconnect.
|
2012-10-10 23:56:24 +11:00 |
|
Con Kolivas
|
783af8768b
|
Implement rudimentary mining.reconnect support for stratum.
|
2012-10-10 23:41:29 +11:00 |
|
Con Kolivas
|
974f65c67f
|
Ignore the value of stratum_active on calling initiate_stratum and assume we're always trying to reinitiate it, and set the active flag to false in that function.
|
2012-10-10 23:22:24 +11:00 |
|
Con Kolivas
|
07605fad60
|
stratum auth can be unset if we fail to authorise on subsequent calls to auth_stratum which undoes the requirement of setting it in one place so set it in pool_active.
|
2012-10-10 23:07:33 +11:00 |
|
Con Kolivas
|
ef822a25ed
|
Detect stratum outage based on either select timing out or receiving an empty buffer and properly re-establish connection by disabling the stratum_active flag, coping with empty buffers in parse_stratum.
|
2012-10-08 11:08:04 +11:00 |
|
Con Kolivas
|
7a01578cc5
|
Only hand off to stratum from getwork if we succeed in initiating the protocol.
|
2012-10-06 10:14:30 +10:00 |
|
Con Kolivas
|
ef63ea3151
|
Drop stratum connect failed message to verbose level only since it's a regular probing message.
|
2012-10-05 12:45:07 +10:00 |
|
Con Kolivas
|
fa444294bf
|
TCP Keepalive in curl is only in very recent versions and not required with regular messages on stratum anyway.
|
2012-10-05 12:41:59 +10:00 |
|
Con Kolivas
|
a8d693029a
|
Move stratum sockets to curl infrastructure with locking around send+recv to begin support for proxies and ssl.
|
2012-10-05 12:37:29 +10:00 |
|
Con Kolivas
|
deb0a9b644
|
Windows doesn't work with MSG_PEEK on recv so move to a continuously updating buffer for incoming messages.
|
2012-10-04 23:18:33 +10:00 |
|
Con Kolivas
|
77c5a006aa
|
Alloca is unreliable on windows so use static arrays in util.c stratum code.
|
2012-10-04 21:00:32 +10:00 |
|
Con Kolivas
|
c113534feb
|
Begin support for mingw stratum build.
Conflicts:
configure.ac
|
2012-10-04 17:52:35 +10:00 |
|
Con Kolivas
|
2fae906440
|
Don't try to parse unneeded parameters in response to mining.subscribe.
|
2012-10-03 21:10:30 +10:00 |
|
Con Kolivas
|
9698858abc
|
Remove the sshare hash entry if we failed to send it.
|
2012-10-03 18:19:31 +10:00 |
|
Con Kolivas
|
3cb373d692
|
Change notify message to info level to avoid spamming repeatedly when a pool is down.
|
2012-10-03 12:01:29 +10:00 |
|
Con Kolivas
|
1b7aa48c8f
|
Initiate stratum the first time in pool_active only, allowing us to switch to it on getting a failed getwork and detecting the presence of stratum on the url at that time.
|
2012-10-02 11:46:48 +10:00 |
|
Con Kolivas
|
d122a789ed
|
Use 5 second timeout on sock full for now as a temporary workaround.
|
2012-10-02 10:19:45 +10:00 |
|
Con Kolivas
|
d851bf3d65
|
Revert "Don't wait on select when first detecting stratum, just receive one line."
This reverts commit 496af92afd .
Not quite right.
|
2012-10-02 10:10:52 +10:00 |
|
Con Kolivas
|
496af92afd
|
Don't wait on select when first detecting stratum, just receive one line.
|
2012-10-02 10:06:37 +10:00 |
|
Con Kolivas
|
bbb092e0da
|
Make the stratum recv buffer larger than the recvsize.
|
2012-10-02 09:08:47 +10:00 |
|
Con Kolivas
|
2941febd05
|
Store a sockaddr url of the stripped url used in determining sockaddr to not confuse it with the stratum url and fix build warnings.
|
2012-10-02 00:00:55 +10:00 |
|