Commit 739cba28a7dfffe24d40a80df4072e78bd2409cf

Con Kolivas 2012-09-30T19:19:46

Rename parse_stratum to parse_method as it is only for stratum messages that contain methods.

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);