No longer try to connect with an invalid AppClient (after errors)

This commit is contained in:
Pierre Pronchery 2012-09-22 21:24:06 +00:00
parent 58cc5b2361
commit c17bb74194

View File

@ -69,7 +69,7 @@ static int _appclient(int verbose, char const * hostname, char const * service,
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "DEBUG: %s(%d, %s, %s, %p, %zu)\n", __func__, verbose, fprintf(stderr, "DEBUG: %s(%d, %s, %s, %p, %zu)\n", __func__, verbose,
hostname, service, (void*)calls, calls_cnt); hostname, service, (void *)calls, calls_cnt);
#endif #endif
if(_appclient_hostname(verbose, hostname, service) != 0 if(_appclient_hostname(verbose, hostname, service) != 0
|| (ac = appclient_new(service)) == NULL) || (ac = appclient_new(service)) == NULL)
@ -78,7 +78,10 @@ static int _appclient(int verbose, char const * hostname, char const * service,
puts("Connected."); puts("Connected.");
for(i = 0; i < calls_cnt; i++) for(i = 0; i < calls_cnt; i++)
if(_appclient_call(verbose, ac, &calls[i]) != 0) if(_appclient_call(verbose, ac, &calls[i]) != 0)
{
ret |= _error(APPCLIENT_PROGNAME, 1); ret |= _error(APPCLIENT_PROGNAME, 1);
break;
}
if(verbose != 0) if(verbose != 0)
puts("Disconnecting"); puts("Disconnecting");
appclient_delete(ac); appclient_delete(ac);
@ -179,8 +182,9 @@ static int _appclient_call(int verbose, AppClient * ac, AppClientCall * call)
if(strcmp(call->name, "glTranslatef") == 0) if(strcmp(call->name, "glTranslatef") == 0)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "DEBUG: %s() %s(%.1f, %.1f, %.1f)\n", fprintf(stderr, "DEBUG: %s() %s(%.1f, %.1f,"
__func__, call->name, " %.1f)\n", __func__,
call->name,
call->args[0]._float, call->args[0]._float,
call->args[1]._float, call->args[1]._float,
call->args[2]._float); call->args[2]._float);
@ -206,8 +210,8 @@ static int _appclient_call(int verbose, AppClient * ac, AppClientCall * call)
break; break;
case 4: case 4:
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "DEBUG: %s() %s(%.1f, %.1f, %.1f, %.1f)\n", fprintf(stderr, "DEBUG: %s() %s(%.1f, %.1f, %.1f,"
__func__, call->name, " %.1f)\n", __func__, call->name,
call->args[0]._float, call->args[0]._float,
call->args[1]._float, call->args[1]._float,
call->args[2]._float, call->args[2]._float,