@ -2112,7 +2112,8 @@ static void copyadvanceafter(char ch, char **param, char **buf)
* ( dst_b + + ) = ' \0 ' ;
* ( dst_b + + ) = ' \0 ' ;
}
}
static bool pooldetails ( char * param , char * * url , char * * user , char * * pass )
static bool pooldetails ( char * param , char * * url , char * * user , char * * pass ,
char * * name , char * * desc , char * * algo )
{
{
char * ptr , * buf ;
char * ptr , * buf ;
@ -2121,24 +2122,31 @@ static bool pooldetails(char *param, char **url, char **user, char **pass)
quit ( 1 , " Failed to malloc pooldetails buf " ) ;
quit ( 1 , " Failed to malloc pooldetails buf " ) ;
* url = buf ;
* url = buf ;
// copy url
copyadvanceafter ( ' , ' , & param , & buf ) ;
copyadvanceafter ( ' , ' , & param , & buf ) ;
if ( ! ( * param ) ) // missing user
if ( ! ( * param ) ) // missing user
goto exitsama ;
goto exitsama ;
* user = buf ;
* user = buf ;
// copy user
copyadvanceafter ( ' , ' , & param , & buf ) ;
copyadvanceafter ( ' , ' , & param , & buf ) ;
if ( ! * param ) // missing pass
if ( ! * param ) // missing pass
goto exitsama ;
goto exitsama ;
* pass = buf ;
* pass = buf ;
copyadvanceafter ( ' , ' , & param , & buf ) ;
if ( ! * param ) // missing name
goto exitsama ;
* name = buf ;
copyadvanceafter ( ' , ' , & param , & buf ) ;
if ( ! * param ) // missing desc
goto exitsama ;
* desc = buf ;
copyadvanceafter ( ' , ' , & param , & buf ) ;
if ( ! * param ) // missing algo
goto exitsama ;
// copy pass
* algo = buf ;
copyadvanceafter ( ' , ' , & param , & buf ) ;
copyadvanceafter ( ' , ' , & param , & buf ) ;
return true ;
return true ;
@ -2151,6 +2159,7 @@ exitsama:
static void addpool ( struct io_data * io_data , __maybe_unused SOCKETTYPE c , char * param , bool isjson , __maybe_unused char group )
static void addpool ( struct io_data * io_data , __maybe_unused SOCKETTYPE c , char * param , bool isjson , __maybe_unused char group )
{
{
char * url , * user , * pass ;
char * url , * user , * pass ;
char * name , * desc , * algo ;
struct pool * pool ;
struct pool * pool ;
char * ptr ;
char * ptr ;
@ -2159,7 +2168,8 @@ static void addpool(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *
return ;
return ;
}
}
if ( ! pooldetails ( param , & url , & user , & pass ) ) {
if ( ! pooldetails ( param , & url , & user , & pass ,
& name , & desc , & algo ) ) {
ptr = escape_string ( param , isjson ) ;
ptr = escape_string ( param , isjson ) ;
message ( io_data , MSG_INVPDP , 0 , ptr , isjson ) ;
message ( io_data , MSG_INVPDP , 0 , ptr , isjson ) ;
if ( ptr ! = param )
if ( ptr ! = param )
@ -2170,7 +2180,7 @@ static void addpool(struct io_data *io_data, __maybe_unused SOCKETTYPE c, char *
pool = add_pool ( ) ;
pool = add_pool ( ) ;
detect_stratum ( pool , url ) ;
detect_stratum ( pool , url ) ;
add_pool_details ( pool , true , url , user , pass ) ;
add_pool_details ( pool , true , url , user , pass , name , desc , algo ) ;
ptr = escape_string ( url , isjson ) ;
ptr = escape_string ( url , isjson ) ;
message ( io_data , MSG_ADDPOOL , 0 , ptr , isjson ) ;
message ( io_data , MSG_ADDPOOL , 0 , ptr , isjson ) ;