Browse Source

increase the max password len to 384

and handle the benchmark yiimp guest user for stats
2upstream 1.7.6-tpruvot
Tanguy Pruvot 9 years ago
parent
commit
4a8e3d9aaa
  1. 4
      miner.h
  2. 2
      pools.cpp
  3. 4
      util.cpp

4
miner.h

@ -668,10 +668,10 @@ struct pool_infos {
int algo; int algo;
char name[64]; char name[64];
// credentials // credentials
char url[256]; char url[512];
char short_url[64]; char short_url[64];
char user[64]; char user[64];
char pass[128]; char pass[384];
// config options // config options
double max_diff; double max_diff;
double max_rate; double max_rate;

2
pools.cpp

@ -205,7 +205,7 @@ bool pool_switch(int thr_id, int pooln)
want_stratum = have_stratum = (p->type & POOL_STRATUM) != 0; want_stratum = have_stratum = (p->type & POOL_STRATUM) != 0;
// yiimp stats reporting // yiimp stats reporting
opt_stratum_stats = (strstr(p->pass, "stats") != NULL) || (strcmp(p->user, "test") == 0); opt_stratum_stats = (strstr(p->pass, "stats") != NULL) || (strcmp(p->user, "benchmark") == 0);
pthread_mutex_unlock(&stratum_work_lock); pthread_mutex_unlock(&stratum_work_lock);

4
util.cpp

@ -614,7 +614,7 @@ err_out:
json_t *json_rpc_call_pool(CURL *curl, struct pool_infos *pool, const char *req, json_t *json_rpc_call_pool(CURL *curl, struct pool_infos *pool, const char *req,
bool longpoll_scan, bool longpoll, int *curl_err) bool longpoll_scan, bool longpoll, int *curl_err)
{ {
char userpass[256]; char userpass[512];
// todo, malloc and store that in pool array // todo, malloc and store that in pool array
snprintf(userpass, sizeof(userpass), "%s%c%s", pool->user, snprintf(userpass, sizeof(userpass), "%s%c%s", pool->user,
strlen(pool->pass)?':':'\0', pool->pass); strlen(pool->pass)?':':'\0', pool->pass);
@ -625,7 +625,7 @@ json_t *json_rpc_call_pool(CURL *curl, struct pool_infos *pool, const char *req,
/* called only from longpoll thread, we have the lp_url */ /* called only from longpoll thread, we have the lp_url */
json_t *json_rpc_longpoll(CURL *curl, char *lp_url, struct pool_infos *pool, const char *req, int *curl_err) json_t *json_rpc_longpoll(CURL *curl, char *lp_url, struct pool_infos *pool, const char *req, int *curl_err)
{ {
char userpass[256]; char userpass[512];
snprintf(userpass, sizeof(userpass), "%s%c%s", pool->user, snprintf(userpass, sizeof(userpass), "%s%c%s", pool->user,
strlen(pool->pass)?':':'\0', pool->pass); strlen(pool->pass)?':':'\0', pool->pass);

Loading…
Cancel
Save