Browse Source

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

nfactor-troky
Con Kolivas 12 years ago
parent
commit
739cba28a7
  1. 2
      cgminer.c
  2. 4
      util.c
  3. 2
      util.h

2
cgminer.c

@ -4055,7 +4055,7 @@ static void *stratum_thread(void *userdata)
s = recv_line(pool->sock); s = recv_line(pool->sock);
if (unlikely(!s)) if (unlikely(!s))
continue; 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); applog(LOG_INFO, "Unknown stratum msg: %s", s);
free(s); free(s);
if (unlikely(pool->swork.clean)) { if (unlikely(pool->swork.clean)) {

4
util.c

@ -1055,7 +1055,7 @@ static bool parse_diff(struct pool *pool, json_t *val)
return true; 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_t *val = NULL, *method, *err_val, *params;
json_error_t err; json_error_t err;
@ -1123,7 +1123,7 @@ bool auth_stratum(struct pool *pool)
/* Parse all data prior sending auth request */ /* Parse all data prior sending auth request */
while (sock_full(pool->sock, false)) { while (sock_full(pool->sock, false)) {
sret = recv_line(pool->sock); sret = recv_line(pool->sock);
if (!parse_stratum(pool, sret)) { if (!parse_method(pool, sret)) {
clear_sock(pool->sock); clear_sock(pool->sock);
applog(LOG_WARNING, "Failed to parse stratum buffer"); applog(LOG_WARNING, "Failed to parse stratum buffer");
free(sret); free(sret);

2
util.h

@ -111,7 +111,7 @@
struct pool; struct pool;
bool sock_send(int sock, char *s, ssize_t len); bool sock_send(int sock, char *s, ssize_t len);
char *recv_line(SOCKETTYPE sock); 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 extract_sockaddr(struct pool *pool, char *url);
bool auth_stratum(struct pool *pool); bool auth_stratum(struct pool *pool);
bool initiate_stratum(struct pool *pool); bool initiate_stratum(struct pool *pool);

Loading…
Cancel
Save