Skip to content
Snippets Groups Projects
Commit cbca6b3c authored by Stephan Bosch's avatar Stephan Bosch
Browse files

Removed various printf()s.

parent e3b369ee
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,7 @@ Next (in order of descending priority/precedence):
* ## MAKE A FIRST RELEASE ##
* Implement notify extension with sole support for mailto mechanism.
* Make this implementation conform section 2.7.2 of RFC3028 (Comparisons Across
Character Sets).
* Verify outgoing mail addresses at runtime when necessary (e.g. after variables
......@@ -35,7 +36,6 @@ Next (in order of descending priority/precedence):
the binary and byte-code format.
* Make the engine and its extensions much more configurable. Possibly this can
be merged with Dovecot's new master config implementation.
* Implement notify extension with sole support for mailto mechanism.
* Implement editheader extension
* Implement mimeloop extension
* Give the byte code format some more thought, it is currently quite rough and
......
......@@ -202,8 +202,6 @@ static bool ext_include_binary_open(struct sieve_binary *sbin)
return FALSE;
}
printf("SCRIPT: %d %d %s\n", block_id, location, str_c(script_name));
if ( location >= EXT_INCLUDE_LOCATION_INVALID ) {
/* Binary is corrupt, recompile */
i_error("sieve: include: dependency block %d of binary %s "
......
......@@ -84,7 +84,6 @@ bool ext_include_variable_import_global
ctx->global_vars = sieve_variable_scope_create(pool, ext_include_my_id);
}
printf("VAR EXPORT: %s\n", variable);
var = sieve_variable_scope_get_variable(ctx->global_vars, variable, TRUE);
} else {
......@@ -101,7 +100,6 @@ bool ext_include_variable_import_global
return FALSE;
}
printf("VAR IMPORT: %s\n", variable);
(void)sieve_variable_scope_declare(ctx->import_vars, variable);
}
......
......@@ -295,22 +295,7 @@ static bool arg_variable_string_validate
sieve_ast_arg_list_add(arglist, strarg);
}
} else {
int i;
/* FIXME: Namespaces are not supported. */
/* DEBUG: Just print the variable substitution: */
printf("NS_VARIABLE: ");
for ( i = 0; i < nelements; i++ ) {
const struct ext_variable_name *cur_element =
array_idx(&substitution, (unsigned int) i);
if ( cur_element->num_variable == -1 ) {
printf("%s.", str_c(cur_element->identifier));
} else {
printf("%d.", cur_element->num_variable);
}
}
printf("\n");
}
strstart = p + 1;
......
......@@ -332,7 +332,7 @@ int sieve_interpreter_continue
interp->pc < sieve_binary_get_code_size(interp->runenv.sbin) ) {
if ( !sieve_interpreter_execute_operation(interp) ) {
printf("Execution aborted.\n");
sieve_runtime_trace(&interp->runenv, "[[EXECUTION ABORTED]]");
ret = -1;
}
}
......
......@@ -145,11 +145,6 @@ static void sieve_lexer_shift(struct sieve_lexer *lexer)
lexer->buffer_pos = 0;
}
/*if ( lexer->buffer != NULL )
printf("D %c\n", lexer->buffer[lexer->buffer_pos]);
else
printf("NULL!\n");*/
}
static inline int sieve_lexer_curchar(struct sieve_lexer *lexer) {
......@@ -597,9 +592,6 @@ bool sieve_lexer_skip_token(struct sieve_lexer *lexer)
if ( !sieve_lexer_scan_raw_token(lexer) ) return FALSE;
}
//sieve_lexer_print_token(lexer);
//printf("\n");
return TRUE;
}
......@@ -413,9 +413,9 @@ int sieve_result_execute
result->action_env.msgdata = msgdata;
result->action_env.scriptenv = senv;
/* Transaction start */
printf("\nTransaction start:\n"); /* REMOVEME */
/*
* Transaction start
*/
rac = result->first_action;
while ( success && rac != NULL ) {
......@@ -429,9 +429,9 @@ int sieve_result_execute
rac = rac->next;
}
/* Transaction execute */
printf("\nTransaction execute:\n"); /* REMOVEME */
/*
* Transaction execute
*/
last_attempted = rac;
rac = result->first_action;
......@@ -471,11 +471,9 @@ int sieve_result_execute
rac = rac->next;
}
/* Transaction commit/rollback */
if ( success ) /* REMOVEME */
printf("\nTransaction commit:\n");
else
printf("\nTransaction rollback:\n");
/*
* Transaction commit/rollback
*/
commit_ok = success;
rac = result->first_action;
......@@ -524,9 +522,6 @@ int sieve_result_execute
rac = rac->next;
}
/* REMOVEME */
printf("\nTransaction result: %s\n", commit_ok ? "success" : "failed");
/* Return value indicates whether the caller should attempt an implicit keep
* of its own. So, if the above transaction fails, but the implicit keep below
* succeeds, the return value is still true. An error is/should be logged
......@@ -536,9 +531,7 @@ int sieve_result_execute
/* Execute implicit keep if the transaction failed or when the implicit keep
* was not canceled during transaction.
*/
if ( !commit_ok || implicit_keep ) {
printf("Executing implicit keep\n");
if ( !commit_ok || implicit_keep ) {
if ( !sieve_result_implicit_keep(result, !commit_ok) )
return -1;
......
......@@ -189,10 +189,19 @@ int main(int argc, char **argv)
sieve_error_handler_accept_infolog(ehandler, TRUE);
/* Run */
if ( sieve_execute(sbin, &msgdata, &scriptenv, ehandler) > 0 )
switch ( sieve_execute(sbin, &msgdata, &scriptenv, ehandler) ) {
case 1:
i_info("Final result: success\n");
else
i_info("Final result: failed (caller please handle implicit keep!)\n");
break;
case 0:
i_info("Final result: failed; resolved with successful implicit keep\n");
break;
case -1:
i_info("Final result: utter failure (caller please handle implicit keep!)\n");
break;
default:
i_info("Final result: unrecognized return value?!\n");
}
sieve_close(&sbin);
sieve_error_handler_unref(&ehandler);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.