Rename parse_stratum to parse_method as it is only for stratum messages that contain methods.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/cgminer.c b/cgminer.c
index d76549e..a8932d5 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -4055,7 +4055,7 @@ static void *stratum_thread(void *userdata)
s = recv_line(pool->sock);
if (unlikely(!s))
continue;
- if (!parse_stratum(pool, s)) /* Create message queues here */
+ if (!parse_method(pool, s)) /* Create message queues here */
applog(LOG_INFO, "Unknown stratum msg: %s", s);
free(s);
if (unlikely(pool->swork.clean)) {
diff --git a/util.c b/util.c
index f6480c4..d478abe 100644
--- a/util.c
+++ b/util.c
@@ -1055,7 +1055,7 @@ static bool parse_diff(struct pool *pool, json_t *val)
return true;
}
-bool parse_stratum(struct pool *pool, char *s)
+bool parse_method(struct pool *pool, char *s)
{
json_t *val = NULL, *method, *err_val, *params;
json_error_t err;
@@ -1123,7 +1123,7 @@ bool auth_stratum(struct pool *pool)
/* Parse all data prior sending auth request */
while (sock_full(pool->sock, false)) {
sret = recv_line(pool->sock);
- if (!parse_stratum(pool, sret)) {
+ if (!parse_method(pool, sret)) {
clear_sock(pool->sock);
applog(LOG_WARNING, "Failed to parse stratum buffer");
free(sret);
diff --git a/util.h b/util.h
index 2746e10..ec9e8d0 100644
--- a/util.h
+++ b/util.h
@@ -111,7 +111,7 @@
struct pool;
bool sock_send(int sock, char *s, ssize_t len);
char *recv_line(SOCKETTYPE sock);
-bool parse_stratum(struct pool *pool, char *s);
+bool parse_method(struct pool *pool, char *s);
bool extract_sockaddr(struct pool *pool, char *url);
bool auth_stratum(struct pool *pool);
bool initiate_stratum(struct pool *pool);