revision of TecsServer / treat "interest" correctly
This commit is contained in:
@@ -137,7 +137,7 @@ int CocCmdWithRetry(CocConn *conn) {
|
||||
ErrShow("try again, error was");
|
||||
}
|
||||
ERR_P(err=str_get_str(conn->resbuf, NULL));
|
||||
if (*err!='\0') { ErrMsg(err); ErrTxt(": (response from server)",0 ); goto OnError; }
|
||||
if (*err!='\0') { ErrMsg(err); ErrTxt(": (response from server)",0 ); return(-2); }
|
||||
return(0);
|
||||
OnError: return(-1);
|
||||
}
|
||||
@@ -145,6 +145,7 @@ int CocCmdWithRetry(CocConn *conn) {
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
int CocSet(CocConn *conn, const char *name, const char *value) {
|
||||
int iret=-1;
|
||||
|
||||
assert(conn!=NULL);
|
||||
str_put_start(conn->cmdbuf);
|
||||
@@ -153,35 +154,36 @@ int CocSet(CocConn *conn, const char *name, const char *value) {
|
||||
ERR_I(str_put_str(conn->cmdbuf, value));
|
||||
ERR_I(str_put_str(conn->cmdbuf, "]"));
|
||||
|
||||
ERR_I(CocCmdWithRetry(conn));
|
||||
ERR_I(iret=CocCmdWithRetry(conn));
|
||||
|
||||
ERR_I(str_get_end(conn->resbuf));
|
||||
return(0);
|
||||
|
||||
OnError: return(-1);
|
||||
OnError: return(iret);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
int CocGetN(CocConn *conn, const char *name, char *value, int reslen) {
|
||||
int iret=-1;
|
||||
|
||||
assert(conn!=NULL);
|
||||
str_put_start(conn->cmdbuf);
|
||||
ERR_I(str_put_str(conn->cmdbuf, name));
|
||||
|
||||
ERR_I(CocCmdWithRetry(conn));
|
||||
ERR_I(iret=CocCmdWithRetry(conn));
|
||||
|
||||
ERR_P(str_nget_str(conn->resbuf, value, reslen));
|
||||
ERR_I(str_get_end(conn->resbuf));
|
||||
return(0);
|
||||
|
||||
OnError: return(-1);
|
||||
OnError: return(iret);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
int CocCmd(CocConn *conn, const char *rwList)
|
||||
{ int setmode, i;
|
||||
{ int setmode, i, iret=-1;
|
||||
const char *t, *s;
|
||||
char nam[32];
|
||||
CocVar *var;
|
||||
@@ -215,7 +217,7 @@ int CocCmd(CocConn *conn, const char *rwList)
|
||||
s=t+1;
|
||||
} while (*t!='\0');
|
||||
|
||||
ERR_I(CocCmdWithRetry(conn));
|
||||
ERR_I(iret=CocCmdWithRetry(conn));
|
||||
|
||||
/* read values */
|
||||
s=rwList;
|
||||
@@ -239,7 +241,7 @@ int CocCmd(CocConn *conn, const char *rwList)
|
||||
ERR_I(str_get_end(conn->resbuf));
|
||||
return(0);
|
||||
|
||||
OnError: return(-1);
|
||||
OnError: return(iret);
|
||||
}
|
||||
|
||||
void CocCloseClient(CocConn *conn) {
|
||||
|
||||
Reference in New Issue
Block a user