Mercurial > dovecot > core-2.2
changeset 15068:002e0a120c2a
Renamed str_tabescape_write() to str_append_tabescaped()
line wrap: on
line diff
--- a/src/anvil/connect-limit.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/anvil/connect-limit.c Sun Sep 16 00:56:51 2012 +0300 @@ -168,7 +168,7 @@ iter = hash_table_iterate_init(limit->ident_pid_hash); while (hash_table_iterate(iter, limit->ident_pid_hash, &i, &value)) { str_truncate(str, 0); - str_tabescape_write(str, i->ident); + str_append_tabescaped(str, i->ident); str_printfa(str, "\t%ld\t%u\n", (long)i->pid, i->refcount); if (o_stream_send(output, str_data(str), str_len(str)) < 0) break;
--- a/src/anvil/penalty.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/anvil/penalty.c Sun Sep 16 00:56:51 2012 +0300 @@ -259,7 +259,7 @@ for (rec = penalty->oldest; rec != NULL; rec = rec->next) { str_truncate(str, 0); - str_tabescape_write(str, rec->ident); + str_append_tabescaped(str, rec->ident); str_printfa(str, "\t%u\t%u\t%u\n", rec->penalty, rec->last_penalty, rec->last_penalty + rec->last_update);
--- a/src/auth/auth-master-connection.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/auth/auth-master-connection.c Sun Sep 16 00:56:51 2012 +0300 @@ -324,7 +324,7 @@ switch (result) { case PASSDB_RESULT_OK: str_printfa(str, "PASS\t%u\tuser=", auth_request->id); - str_tabescape_write(str, auth_request->user); + str_append_tabescaped(str, auth_request->user); if (reply != NULL) { str_append_c(str, '\t'); str_append(str, auth_stream_reply_export(reply));
--- a/src/auth/auth-stream.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/auth/auth-stream.c Sun Sep 16 00:56:51 2012 +0300 @@ -36,7 +36,7 @@ } if (value != NULL) { /* escape dangerous characters in the value */ - str_tabescape_write(reply->str, value); + str_append_tabescaped(reply->str, value); } }
--- a/src/auth/checkpassword-reply.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/auth/checkpassword-reply.c Sun Sep 16 00:56:51 2012 +0300 @@ -25,7 +25,7 @@ return 1; } str_printfa(str, "user="); - str_tabescape_write(str, user); + str_append_tabescaped(str, user); str_append_c(str, '\t'); } @@ -36,7 +36,7 @@ return 1; } str_printfa(str, "userdb_home="); - str_tabescape_write(str, home); + str_append_tabescaped(str, home); str_append_c(str, '\t'); } @@ -50,9 +50,9 @@ uid_found = TRUE; else if (strcmp(key, "userdb_gid") == 0) gid_found = TRUE; - str_tabescape_write(str, key); + str_append_tabescaped(str, key); str_append_c(str, '='); - str_tabescape_write(str, value); + str_append_tabescaped(str, value); str_append_c(str, '\t'); } }
--- a/src/doveadm/doveadm-mail-index.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/doveadm/doveadm-mail-index.c Sun Sep 16 00:56:51 2012 +0300 @@ -147,9 +147,9 @@ string_t *str = t_str_new(256); str_append(str, "APPEND\t0\t"); - str_tabescape_write(str, user->username); + str_append_tabescaped(str, user->username); str_append_c(str, '\t'); - str_tabescape_write(str, mailbox); + str_append_tabescaped(str, mailbox); str_printfa(str, "\t%u\n", ctx->max_recent_msgs); if (write_full(ctx->queue_fd, str_data(str), str_len(str)) < 0) i_fatal("write(indexer) failed: %m");
--- a/src/doveadm/doveadm-mail-server.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/doveadm/doveadm-mail-server.c Sun Sep 16 00:56:51 2012 +0300 @@ -128,12 +128,12 @@ str_append_c(cmd, 'v'); str_append_c(cmd, '\t'); - str_tabescape_write(cmd, username); + str_append_tabescaped(cmd, username); str_append_c(cmd, '\t'); - str_tabescape_write(cmd, cmd_ctx->cmd->name); + str_append_tabescaped(cmd, cmd_ctx->cmd->name); for (i = 0; cmd_ctx->full_args[i] != NULL; i++) { str_append_c(cmd, '\t'); - str_tabescape_write(cmd, cmd_ctx->full_args[i]); + str_append_tabescaped(cmd, cmd_ctx->full_args[i]); } str_append_c(cmd, '\n'); server_connection_cmd(conn, str_c(cmd), doveadm_cmd_callback, conn);
--- a/src/doveadm/doveadm-print-server.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/doveadm/doveadm-print-server.c Sun Sep 16 00:56:51 2012 +0300 @@ -39,7 +39,7 @@ static void doveadm_print_server_print(const char *value) { - str_tabescape_write(ctx.str, value); + str_append_tabescaped(ctx.str, value); str_append_c(ctx.str, '\t'); if (++ctx.header_idx == ctx.header_count) { @@ -56,7 +56,7 @@ return; } T_BEGIN { - str_tabescape_write(ctx.str, t_strndup(value, size)); + str_append_tabescaped(ctx.str, t_strndup(value, size)); } T_END; if (str_len(ctx.str) >= IO_BLOCK_SIZE)
--- a/src/doveadm/dsync/dsync-ibc-stream.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/doveadm/dsync/dsync-ibc-stream.c Sun Sep 16 00:56:51 2012 +0300 @@ -689,7 +689,7 @@ are. */ namestr = t_str_new(128); for (; *name != NULL; name++) { - str_tabescape_write(namestr, *name); + str_append_tabescaped(namestr, *name); str_append_c(namestr, '\t'); } str_truncate(namestr, str_len(namestr)-1); @@ -1166,10 +1166,10 @@ unsigned int i, count; changes = array_get(&change->keyword_changes, &count); - str_tabescape_write(kw_str, changes[0]); + str_append_tabescaped(kw_str, changes[0]); for (i = 1; i < count; i++) { str_append_c(kw_str, '\t'); - str_tabescape_write(kw_str, changes[i]); + str_append_tabescaped(kw_str, changes[i]); } dsync_serializer_encode_add(encoder, "keyword_changes", str_c(kw_str));
--- a/src/doveadm/dsync/dsync-serializer.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/doveadm/dsync/dsync-serializer.c Sun Sep 16 00:56:51 2012 +0300 @@ -56,7 +56,7 @@ for (i = 0; serializer->keys[i] != NULL; i++) { if (i > 0) str_append_c(str, '\t'); - str_tabescape_write(str, serializer->keys[i]); + str_append_tabescaped(str, serializer->keys[i]); } str_append_c(str, '\n'); return str_c(str); @@ -108,7 +108,7 @@ else { if (values[i][0] == NULL_CHR) str_append_c(output, NULL_CHR); - str_tabescape_write(output, values[i]); + str_append_tabescaped(output, values[i]); } } str_append_c(output, '\n');
--- a/src/imap-urlauth/imap-urlauth-client.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/imap-urlauth/imap-urlauth-client.c Sun Sep 16 00:56:51 2012 +0300 @@ -225,7 +225,7 @@ str = t_str_new(256); str_append(str, "ACCESS\t"); if (client->username != NULL) - str_tabescape_write(str, client->username); + str_append_tabescaped(str, client->username); if (client->set->mail_debug) str_append(str, "\tdebug"); if (array_count(&client->access_apps) > 0) { @@ -234,7 +234,7 @@ str_append(str, apps[0]); for (i = 1; i < count; i++) { str_append_c(str, ','); - str_tabescape_write(str, apps[i]); + str_append_tabescaped(str, apps[i]); } } str_append(str, "\n");
--- a/src/indexer/worker-connection.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/indexer/worker-connection.c Sun Sep 16 00:56:51 2012 +0300 @@ -238,9 +238,9 @@ T_BEGIN { string_t *str = t_str_new(128); - str_tabescape_write(str, request->username); + str_append_tabescaped(str, request->username); str_append_c(str, '\t'); - str_tabescape_write(str, request->mailbox); + str_append_tabescaped(str, request->mailbox); str_printfa(str, "\t%u\t", request->max_recent_msgs); if (request->index) str_append_c(str, 'i');
--- a/src/lib-auth/auth-client-request.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/lib-auth/auth-client-request.c Sun Sep 16 00:56:51 2012 +0300 @@ -31,9 +31,9 @@ str = t_str_new(512); str_printfa(str, "AUTH\t%u\t", request->id); - str_tabescape_write(str, info->mech); + str_append_tabescaped(str, info->mech); str_append(str, "\tservice="); - str_tabescape_write(str, info->service); + str_append_tabescaped(str, info->service); if ((info->flags & AUTH_REQUEST_FLAG_SUPPORT_FINAL_RESP) != 0) str_append(str, "\tfinal-resp-ok"); @@ -46,11 +46,11 @@ if (info->session_id != NULL) { str_append(str, "\tsession="); - str_tabescape_write(str, info->session_id); + str_append_tabescaped(str, info->session_id); } if (info->cert_username != NULL) { str_append(str, "\tcert_username="); - str_tabescape_write(str, info->cert_username); + str_append_tabescaped(str, info->cert_username); } if (info->local_ip.family != 0) str_printfa(str, "\tlip=%s", net_ip2addr(&info->local_ip)); @@ -62,7 +62,7 @@ str_printfa(str, "\trport=%u", info->remote_port); if (info->initial_resp_base64 != NULL) { str_append(str, "\tresp="); - str_tabescape_write(str, info->initial_resp_base64); + str_append_tabescaped(str, info->initial_resp_base64); } str_append_c(str, '\n');
--- a/src/lib-auth/auth-master.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/lib-auth/auth-master.c Sun Sep 16 00:56:51 2012 +0300 @@ -595,7 +595,7 @@ if (users != NULL) { for (; *users != NULL; users++) { str_append_c(str, '\t'); - str_tabescape_write(str, *users); + str_append_tabescaped(str, *users); } } str_append_c(str, '\n');
--- a/src/lib-imap-urlauth/imap-urlauth-connection.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/lib-imap-urlauth/imap-urlauth-connection.c Sun Sep 16 00:56:51 2012 +0300 @@ -256,7 +256,7 @@ cmd = t_str_new(128); str_append(cmd, "URL\t"); - str_tabescape_write(cmd, urlreq->url); + str_append_tabescaped(cmd, urlreq->url); if ((urlreq->flags & IMAP_URLAUTH_FETCH_FLAG_BODYPARTSTRUCTURE) != 0) str_append(cmd, "\tbpstruct"); if ((urlreq->flags & IMAP_URLAUTH_FETCH_FLAG_BINARY) != 0) @@ -898,12 +898,12 @@ str = t_str_new(128); str_printfa(str, IMAP_URLAUTH_HANDSHAKE"AUTH\t%s\t", my_pid); - str_tabescape_write(str, conn->user->username); + str_append_tabescaped(str, conn->user->username); str_append_c(str, '\t'); if (conn->session_id != NULL) - str_tabescape_write(str, conn->session_id); + str_append_tabescaped(str, conn->session_id); str_append_c(str, '\t'); - str_tabescape_write(str, conn->user->auth_token); + str_append_tabescaped(str, conn->user->auth_token); str_append_c(str, '\n'); if (o_stream_send(conn->output, str_data(str), str_len(str)) < 0) { i_warning("Error sending handshake to imap-urlauth server: %m");
--- a/src/lib-master/master-instance.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/lib-master/master-instance.c Sun Sep 16 00:56:51 2012 +0300 @@ -137,12 +137,12 @@ array_foreach(&list->instances, inst) { str_truncate(str, 0); str_printfa(str, "%ld\t", (long)inst->last_used); - str_tabescape_write(str, inst->name); + str_append_tabescaped(str, inst->name); str_append_c(str, '\t'); - str_tabescape_write(str, inst->base_dir); + str_append_tabescaped(str, inst->base_dir); str_append_c(str, '\t'); if (inst->config_path != NULL) - str_tabescape_write(str, inst->config_path); + str_append_tabescaped(str, inst->config_path); str_append_c(str, '\n'); o_stream_nsend(output, str_data(str), str_len(str)); }
--- a/src/lib-master/master-login.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/lib-master/master-login.c Sun Sep 16 00:56:51 2012 +0300 @@ -319,7 +319,7 @@ net_ip2addr(&client->auth_req.remote_ip)); for (i = 0; auth_args[i] != NULL; i++) { str_append_c(str, '\t'); - str_tabescape_write(str, auth_args[i]); + str_append_tabescaped(str, auth_args[i]); } str_append_c(str, '\n'); ret = fd_send(fd, client->fd, str_data(str), str_len(str));
--- a/src/lib/strescape.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/lib/strescape.c Sun Sep 16 00:56:51 2012 +0300 @@ -77,7 +77,7 @@ return start; } -void str_tabescape_write(string_t *dest, const char *src) +void str_append_tabescaped(string_t *dest, const char *src) { for (; *src != '\0'; src++) { switch (*src) { @@ -113,7 +113,7 @@ if (*p <= '\r') { tmp = t_str_new(128); str_append_n(tmp, str, p-str); - str_tabescape_write(tmp, p); + str_append_tabescaped(tmp, p); return str_c(tmp); } }
--- a/src/lib/strescape.h Sun Sep 16 00:52:39 2012 +0300 +++ b/src/lib/strescape.h Sun Sep 16 00:56:51 2012 +0300 @@ -15,7 +15,7 @@ /* For Dovecot's internal protocols: Escape \001, \t, \r and \n characters using \001. */ const char *str_tabescape(const char *str); -void str_tabescape_write(string_t *dest, const char *src); +void str_append_tabescaped(string_t *dest, const char *src); void str_append_tabunescaped(string_t *dest, const void *src, size_t src_size); char *str_tabunescape(char *str);
--- a/src/log/doveadm-connection.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/log/doveadm-connection.c Sun Sep 16 00:56:51 2012 +0300 @@ -32,9 +32,9 @@ str_printfa(str, "%s\t%ld\t", failure_log_type_names[error->type], (long)error->timestamp); - str_tabescape_write(str, error->prefix); + str_append_tabescaped(str, error->prefix); str_append_c(str, '\t'); - str_tabescape_write(str, error->text); + str_append_tabescaped(str, error->text); str_append_c(str, '\n'); if (o_stream_send(conn->output, str_data(str), str_len(str)) < 0) {
--- a/src/master/service-process.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/master/service-process.c Sun Sep 16 00:56:51 2012 +0300 @@ -84,7 +84,7 @@ if (listeners[i]->fd != -1 && (listeners[i]->type != SERVICE_LISTENER_INET || !listeners[i]->set.inetset.set->ssl)) { - str_tabescape_write(listener_names, listeners[i]->name); + str_append_tabescaped(listener_names, listeners[i]->name); str_append_c(listener_names, '\t'); dup2_append(&dups, listeners[i]->fd, fd++); socket_listener_count++; @@ -96,7 +96,7 @@ if (listeners[i]->fd != -1 && listeners[i]->type == SERVICE_LISTENER_INET && listeners[i]->set.inetset.set->ssl) { - str_tabescape_write(listener_names, listeners[i]->name); + str_append_tabescaped(listener_names, listeners[i]->name); str_append_c(listener_names, '\t'); dup2_append(&dups, listeners[i]->fd, fd++); socket_listener_count++;
--- a/src/plugins/replication/replication-plugin.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/plugins/replication/replication-plugin.c Sun Sep 16 00:56:51 2012 +0300 @@ -66,7 +66,7 @@ } /* <username> \t <priority> */ str = t_str_new(256); - str_tabescape_write(str, user->username); + str_append_tabescaped(str, user->username); str_append_c(str, '\t'); switch (priority) { case REPLICATION_PRIORITY_NONE: @@ -134,7 +134,7 @@ /* <username> \t "sync" */ str = t_str_new(256); - str_tabescape_write(str, user->username); + str_append_tabescaped(str, user->username); str_append(str, "\tsync\n"); alarm(ruser->sync_secs); if (write_full(fd, str_data(str), str_len(str)) < 0) {
--- a/src/plugins/stats/stats-connection.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/plugins/stats/stats-connection.c Sun Sep 16 00:56:51 2012 +0300 @@ -108,9 +108,9 @@ /* required fields */ str_append(str, guid_128_to_string(suser->session_guid)); str_append_c(str, '\t'); - str_tabescape_write(str, user->username); + str_append_tabescaped(str, user->username); str_append_c(str, '\t'); - str_tabescape_write(str, user->service); + str_append_tabescaped(str, user->service); str_printfa(str, "\t%s", my_pid); /* optional fields */
--- a/src/replication/replicator/doveadm-connection.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/replication/replicator/doveadm-connection.c Sun Sep 16 00:56:51 2012 +0300 @@ -181,7 +181,7 @@ /* <flags> <username> <command> [<args>] */ cmd = t_str_new(256); str_append_c(cmd, '\t'); - str_tabescape_write(cmd, username); + str_append_tabescaped(cmd, username); str_append(cmd, "\tsync\t-d"); if (full) str_append(cmd, "\t-f");
--- a/src/replication/replicator/replicator-queue.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/replication/replicator/replicator-queue.c Sun Sep 16 00:56:51 2012 +0300 @@ -328,7 +328,7 @@ static void replicator_queue_export_user(struct replicator_user *user, string_t *str) { - str_tabescape_write(str, user->username); + str_append_tabescaped(str, user->username); str_printfa(str, "\t%d\t%lld\t%lld\t%lld", (int)user->priority, (long long)user->last_update, (long long)user->last_fast_sync,
--- a/src/stats/client-export.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/stats/client-export.c Sun Sep 16 00:56:51 2012 +0300 @@ -268,16 +268,16 @@ continue; str_truncate(cmd->str, 0); - str_tabescape_write(cmd->str, command->name); + str_append_tabescaped(cmd->str, command->name); str_append_c(cmd->str, '\t'); - str_tabescape_write(cmd->str, command->args); + str_append_tabescaped(cmd->str, command->args); str_append_c(cmd->str, '\t'); T_BEGIN { str_append(cmd->str, guid_128_to_string(command->session->guid)); str_append_c(cmd->str, '\t'); - str_tabescape_write(cmd->str, - command->session->user->name); + str_append_tabescaped(cmd->str, + command->session->user->name); } T_END; client_export_timeval(cmd->str, &command->last_update); client_export_mail_stats(cmd->str, &command->stats); @@ -320,14 +320,14 @@ T_BEGIN { str_append(cmd->str, guid_128_to_string(session->guid)); str_append_c(cmd->str, '\t'); - str_tabescape_write(cmd->str, session->user->name); + str_append_tabescaped(cmd->str, session->user->name); str_append_c(cmd->str, '\t'); if (session->ip != NULL) { str_append(cmd->str, net_ip2addr(&session->ip->ip)); } str_append_c(cmd->str, '\t'); - str_tabescape_write(cmd->str, session->service); + str_append_tabescaped(cmd->str, session->service); } T_END; str_printfa(cmd->str, "\t%ld", (long)session->pid); str_printfa(cmd->str, "\t%d", !session->disconnected); @@ -369,7 +369,7 @@ continue; str_truncate(cmd->str, 0); - str_tabescape_write(cmd->str, user->name); + str_append_tabescaped(cmd->str, user->name); str_printfa(cmd->str, "\t%ld", (long)user->reset_timestamp); client_export_timeval(cmd->str, &user->last_update); str_printfa(cmd->str, "\t%u\t%u", @@ -410,7 +410,7 @@ continue; str_truncate(cmd->str, 0); - str_tabescape_write(cmd->str, domain->name); + str_append_tabescaped(cmd->str, domain->name); str_printfa(cmd->str, "\t%ld", (long)domain->reset_timestamp); client_export_timeval(cmd->str, &domain->last_update); str_printfa(cmd->str, "\t%u\t%u",
--- a/src/util/script-login.c Sun Sep 16 00:52:39 2012 +0300 +++ b/src/util/script-login.c Sun Sep 16 00:56:51 2012 +0300 @@ -170,7 +170,7 @@ value = getenv(t_str_ucase(*keys)); if (value != NULL) { str_append_c(reply, '\t'); - str_tabescape_write(reply, + str_append_tabescaped(reply, t_strconcat(t_str_lcase(*keys), "=", value, NULL)); }