j++;
break;
} else {
- if ( lutil_atoi( &si->si_retrynum_init[j], retry_list[j*2+1] ) != 0 ) {
+ if ( lutil_atoi( &si->si_retrynum_init[j], retry_list[j*2+1] ) != 0
+ || si->si_retrynum_init[j] <= 0 )
+ {
snprintf( c->msg, sizeof( c->msg ),
"Error: invalid initial retry number \"%s\" (#%d)",
retry_list[j*2+1], j );
/* do some cleanup */
return 1;
}
- if ( lutil_atoi( &si->si_retrynum[j], retry_list[j*2+1] ) != 0 ) {
+ if ( lutil_atoi( &si->si_retrynum[j], retry_list[j*2+1] ) != 0
+ || si->si_retrynum[j] <= 0 )
+ {
snprintf( c->msg, sizeof( c->msg ),
"Error: invalid retry number \"%s\" (#%d)",
retry_list[j*2+1], j );
STRLENOF( SLIMITSTR "=") ) )
{
val = c->argv[ i ] + STRLENOF( SLIMITSTR "=" );
- if ( lutil_atoi( &si->si_slimit, val ) != 0 ) {
+ if ( strcasecmp( val, "unlimited" ) == 0 ) {
+ si->si_slimit = 0;
+
+ } else if ( lutil_atoi( &si->si_slimit, val ) != 0 || val < 0 ) {
snprintf( c->msg, sizeof( c->msg ),
"invalid size limit value \"%s\".\n",
val );
STRLENOF( TLIMITSTR "=" ) ) )
{
val = c->argv[ i ] + STRLENOF( TLIMITSTR "=" );
- if ( lutil_atoi( &si->si_tlimit, val ) != 0 ) {
+ if ( strcasecmp( val, "unlimited" ) == 0 ) {
+ si->si_tlimit = 0;
+
+ } else if ( lutil_atoi( &si->si_tlimit, val ) != 0 || val < 0 ) {
snprintf( c->msg, sizeof( c->msg ),
"invalid time limit value \"%s\".\n",
val );