mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-22 20:44:19 +00:00
Make the stratum recv buffer larger than the recvsize.
This commit is contained in:
parent
df91df3507
commit
bbb092e0da
8
util.c
8
util.c
@ -887,7 +887,7 @@ out_unlock:
|
|||||||
return ret;;
|
return ret;;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RECVSIZE 8192
|
#define RECVSIZE 8191
|
||||||
|
|
||||||
static void clear_sock(SOCKETTYPE sock)
|
static void clear_sock(SOCKETTYPE sock)
|
||||||
{
|
{
|
||||||
@ -921,7 +921,7 @@ char *recv_line(SOCKETTYPE sock)
|
|||||||
char *sret = NULL, *s, c;
|
char *sret = NULL, *s, c;
|
||||||
ssize_t offset = 0;
|
ssize_t offset = 0;
|
||||||
|
|
||||||
s = alloca(RECVSIZE);
|
s = alloca(RECVSIZE + 1);
|
||||||
if (SOCKETFAIL(recv(sock, s, RECVSIZE, MSG_PEEK))) {
|
if (SOCKETFAIL(recv(sock, s, RECVSIZE, MSG_PEEK))) {
|
||||||
applog(LOG_DEBUG, "Failed to recv sock in recv_line");
|
applog(LOG_DEBUG, "Failed to recv sock in recv_line");
|
||||||
goto out;
|
goto out;
|
||||||
@ -1136,7 +1136,7 @@ bool auth_stratum(struct pool *pool)
|
|||||||
json_error_t err;
|
json_error_t err;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
s = alloca(RECVSIZE);
|
s = alloca(RECVSIZE + 1);
|
||||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.authorize\", \"params\": [\"%s\", \"%s\"]}",
|
sprintf(s, "{\"id\": %d, \"method\": \"mining.authorize\", \"params\": [\"%s\", \"%s\"]}",
|
||||||
swork_id++, pool->rpc_user, pool->rpc_pass);
|
swork_id++, pool->rpc_user, pool->rpc_pass);
|
||||||
|
|
||||||
@ -1196,7 +1196,7 @@ bool initiate_stratum(struct pool *pool)
|
|||||||
if (pool->stratum_active)
|
if (pool->stratum_active)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
s = alloca(RECVSIZE);
|
s = alloca(RECVSIZE + 1);
|
||||||
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": []}", swork_id++);
|
sprintf(s, "{\"id\": %d, \"method\": \"mining.subscribe\", \"params\": []}", swork_id++);
|
||||||
|
|
||||||
pool->sock = socket(AF_INET, SOCK_STREAM, 0);
|
pool->sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user