<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11660">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_musiconhold: Use stringfields instead of fixed sized buffers<br><br>Change-Id: Icc6dd695cf254de2fc9968fa3bc7330c24cc7bb8<br>---<br>M res/res_musiconhold.c<br>1 file changed, 89 insertions(+), 43 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/60/11660/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c</span><br><span>index a1352c2..d94da4c 100644</span><br><span>--- a/res/res_musiconhold.c</span><br><span>+++ b/res/res_musiconhold.c</span><br><span>@@ -126,7 +126,15 @@</span><br><span> </span><br><span> static int respawn_time = 20;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+#define MOH_STATE_STRFIELD_INIT 256</span><br><span style="color: hsl(120, 100%, 40%);">+#define MOH_CLASS_STRFIELD_INIT 512</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* If you add any fields to this struct, update moh_files_state_reset appropriately */</span><br><span> struct moh_files_state {</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_DECLARE_STRING_FIELDS(</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_STRING_FIELD(name);</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_STRING_FIELD(save_pos_filename);</span><br><span style="color: hsl(120, 100%, 40%);">+ );</span><br><span> /*! Holds a reference to the MOH class. */</span><br><span> struct mohclass *class;</span><br><span> struct ast_format *origwfmt;</span><br><span>@@ -137,8 +145,6 @@</span><br><span> int pos;</span><br><span> int save_pos;</span><br><span> int save_total;</span><br><span style="color: hsl(0, 100%, 40%);">- char name[MAX_MUSICCLASS];</span><br><span style="color: hsl(0, 100%, 40%);">- char save_pos_filename[PATH_MAX];</span><br><span> };</span><br><span> </span><br><span> #define MOH_QUIET (1 << 0)</span><br><span>@@ -165,11 +171,13 @@</span><br><span> };</span><br><span> </span><br><span> struct mohclass {</span><br><span style="color: hsl(0, 100%, 40%);">- char name[MAX_MUSICCLASS];</span><br><span style="color: hsl(0, 100%, 40%);">- char dir[256];</span><br><span style="color: hsl(0, 100%, 40%);">- char args[256];</span><br><span style="color: hsl(0, 100%, 40%);">- char announcement[256];</span><br><span style="color: hsl(0, 100%, 40%);">- char mode[80];</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_DECLARE_STRING_FIELDS(</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_STRING_FIELD(name);</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_STRING_FIELD(dir);</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_STRING_FIELD(args);</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_STRING_FIELD(announcement);</span><br><span style="color: hsl(120, 100%, 40%);">+ AST_STRING_FIELD(mode);</span><br><span style="color: hsl(120, 100%, 40%);">+ );</span><br><span> char digit;</span><br><span> /*! A vector of filenames in "files" mode */</span><br><span> struct ast_vector_string files;</span><br><span>@@ -378,7 +386,7 @@</span><br><span> }</span><br><span> </span><br><span> /* Record the pointer to the filename for position resuming later */</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(state->save_pos_filename, AST_VECTOR_GET(&state->class->files, state->pos), sizeof(state->save_pos_filename));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_set(state, save_pos_filename, AST_VECTOR_GET(&state->class->files, state->pos));</span><br><span> </span><br><span> ast_debug(1, "%s Opened file %d '%s'\n", ast_channel_name(chan), state->pos, state->save_pos_filename);</span><br><span> </span><br><span>@@ -484,6 +492,22 @@</span><br><span> return res;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static void moh_files_state_reset(struct moh_files_state *state)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_init(state, 0);</span><br><span style="color: hsl(120, 100%, 40%);">+ state->class = NULL; /* Unref'd elsewhere */</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(state->origwfmt);</span><br><span style="color: hsl(120, 100%, 40%);">+ state->origwfmt = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(state->mohwfmt);</span><br><span style="color: hsl(120, 100%, 40%);">+ state->mohwfmt = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ state->announcement = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ state->samples = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ state->sample_queue = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ state->pos = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ state->save_pos = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ state->save_total = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> static void *moh_files_alloc(struct ast_channel *chan, void *params)</span><br><span> {</span><br><span> struct moh_files_state *state;</span><br><span>@@ -491,7 +515,7 @@</span><br><span> size_t file_count;</span><br><span> </span><br><span> state = ast_channel_music_state(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!state && (state = ast_calloc(1, sizeof(*state)))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!state && (state = ast_calloc_with_stringfields(1, struct moh_files_state, MOH_STATE_STRFIELD_INIT))) {</span><br><span> ast_channel_music_state_set(chan, state);</span><br><span> ast_module_ref(ast_module_info->self);</span><br><span> } else {</span><br><span>@@ -509,9 +533,7 @@</span><br><span> /* Resume MOH from where we left off last time or start from scratch? */</span><br><span> if (state->save_total != file_count || strcmp(state->name, class->name) != 0) {</span><br><span> /* Start MOH from scratch. */</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_cleanup(state->origwfmt);</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_cleanup(state->mohwfmt);</span><br><span style="color: hsl(0, 100%, 40%);">- memset(state, 0, sizeof(*state));</span><br><span style="color: hsl(120, 100%, 40%);">+ moh_files_state_reset(state);</span><br><span> if (ast_test_flag(class, MOH_RANDOMIZE) && file_count) {</span><br><span> state->pos = ast_random() % file_count;</span><br><span> }</span><br><span>@@ -522,7 +544,7 @@</span><br><span> ao2_replace(state->origwfmt, ast_channel_writeformat(chan));</span><br><span> ao2_replace(state->mohwfmt, ast_channel_writeformat(chan));</span><br><span> /* For comparison on restart of MOH (see above) */</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(state->name, class->name, sizeof(state->name));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_set(state, name, class->name);</span><br><span> state->save_total = file_count;</span><br><span> </span><br><span> moh_post_start(chan, class->name);</span><br><span>@@ -547,14 +569,14 @@</span><br><span> static void moh_handle_digit(struct ast_channel *chan, char digit)</span><br><span> {</span><br><span> struct mohclass *class;</span><br><span style="color: hsl(0, 100%, 40%);">- const char *classname = NULL;</span><br><span> </span><br><span> if ((class = get_mohbydigit(digit))) {</span><br><span style="color: hsl(0, 100%, 40%);">- classname = ast_strdupa(class->name);</span><br><span style="color: hsl(120, 100%, 40%);">+ char *classname = ast_strdup(class->name);</span><br><span> class = mohclass_unref(class, "Unreffing ao2_find from finding by digit");</span><br><span> ast_channel_musicclass_set(chan, classname);</span><br><span> ast_moh_stop(chan);</span><br><span> ast_moh_start(chan, classname, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(classname);</span><br><span> }</span><br><span> }</span><br><span> </span><br><span>@@ -925,7 +947,11 @@</span><br><span> .flags = 0,</span><br><span> };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(tmp_class.name, name, sizeof(tmp_class.name));</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_string_field_init(&tmp_class, MOH_CLASS_STRFIELD_INIT)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_set(&tmp_class, name, name);</span><br><span> </span><br><span> moh = __ao2_find(mohclasses, &tmp_class, flags,</span><br><span> "get_mohbyname", file, lineno, funcname);</span><br><span>@@ -1008,7 +1034,7 @@</span><br><span> </span><br><span> /* Initiating music_state for current channel. Channel should know name of moh class */</span><br><span> state = ast_channel_music_state(chan);</span><br><span style="color: hsl(0, 100%, 40%);">- if (!state && (state = ast_calloc(1, sizeof(*state)))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!state && (state = ast_calloc_with_stringfields(1, struct moh_files_state, MOH_STATE_STRFIELD_INIT))) {</span><br><span> ast_channel_music_state_set(chan, state);</span><br><span> ast_module_ref(ast_module_info->self);</span><br><span> } else {</span><br><span>@@ -1019,9 +1045,7 @@</span><br><span> mohclass_unref(state->class, "Uh Oh. Restarting MOH with an active class");</span><br><span> ast_log(LOG_WARNING, "Uh Oh. Restarting MOH with an active class\n");</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_cleanup(state->origwfmt);</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_cleanup(state->mohwfmt);</span><br><span style="color: hsl(0, 100%, 40%);">- memset(state, 0, sizeof(*state));</span><br><span style="color: hsl(120, 100%, 40%);">+ moh_files_state_reset(state);</span><br><span> }</span><br><span> </span><br><span> if ((res = mohalloc(class))) {</span><br><span>@@ -1078,15 +1102,15 @@</span><br><span> {</span><br><span> for (; var; var = var->next) {</span><br><span> if (!strcasecmp(var->name, "name")) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(mohclass->name, var->value, sizeof(mohclass->name));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_set(mohclass, name, var->value);</span><br><span> } else if (!strcasecmp(var->name, "mode")) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(mohclass->mode, var->value, sizeof(mohclass->mode));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_set(mohclass, mode, var->value);</span><br><span> } else if (!strcasecmp(var->name, "directory")) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(mohclass->dir, var->value, sizeof(mohclass->dir));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_set(mohclass, dir, var->value);</span><br><span> } else if (!strcasecmp(var->name, "application")) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(mohclass->args, var->value, sizeof(mohclass->args));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_set(mohclass, args, var->value);</span><br><span> } else if (!strcasecmp(var->name, "announcement")) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(mohclass->announcement, var->value, sizeof(mohclass->announcement));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_set(mohclass, announcement, var->value);</span><br><span> ast_set_flag(mohclass, MOH_ANNOUNCEMENT);</span><br><span> } else if (!strcasecmp(var->name, "digit") && (isdigit(*var->value) || strchr("*#", *var->value))) {</span><br><span> mohclass->digit = *var->value;</span><br><span>@@ -1136,27 +1160,35 @@</span><br><span> </span><br><span> DIR *files_DIR;</span><br><span> struct dirent *files_dirent;</span><br><span style="color: hsl(0, 100%, 40%);">- char dir_path[PATH_MAX - sizeof(class->dir)];</span><br><span style="color: hsl(0, 100%, 40%);">- char filepath[PATH_MAX];</span><br><span style="color: hsl(0, 100%, 40%);">- char *ext;</span><br><span style="color: hsl(0, 100%, 40%);">- struct stat statbuf;</span><br><span style="color: hsl(0, 100%, 40%);">- int res;</span><br><span style="color: hsl(120, 100%, 40%);">+ char *dir_path;</span><br><span> </span><br><span> if (class->dir[0] != '/') {</span><br><span style="color: hsl(0, 100%, 40%);">- snprintf(dir_path, sizeof(dir_path), "%s/%s", ast_config_AST_DATA_DIR, class->dir);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_asprintf(&dir_path, "%s/%s", ast_config_AST_DATA_DIR, class->dir) < 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+ dir_path = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> } else {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(dir_path, class->dir, sizeof(dir_path));</span><br><span style="color: hsl(120, 100%, 40%);">+ dir_path = ast_strdup(class->dir);</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!dir_path) {</span><br><span style="color: hsl(120, 100%, 40%);">+ return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> ast_debug(4, "Scanning '%s' for files for class '%s'\n", dir_path, class->name);</span><br><span> files_DIR = opendir(dir_path);</span><br><span> if (!files_DIR) {</span><br><span> ast_log(LOG_WARNING, "Cannot open dir %s or dir does not exist\n", dir_path);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(dir_path);</span><br><span> return -1;</span><br><span> }</span><br><span> </span><br><span> AST_VECTOR_RESET(&class->files, ast_free);</span><br><span> </span><br><span> while ((files_dirent = readdir(files_DIR))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ struct stat statbuf;</span><br><span style="color: hsl(120, 100%, 40%);">+ char *filepath, *ext;</span><br><span style="color: hsl(120, 100%, 40%);">+ int res;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* The file name must be at least long enough to have the file type extension */</span><br><span> if ((strlen(files_dirent->d_name) < 4))</span><br><span> continue;</span><br><span>@@ -1169,34 +1201,41 @@</span><br><span> if (!strchr(files_dirent->d_name, '.'))</span><br><span> continue;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- snprintf(filepath, sizeof(filepath), "%s/%s", dir_path, files_dirent->d_name);</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We transfer this heap allocated buffer to the vector, so in the optimal case</span><br><span style="color: hsl(120, 100%, 40%);">+ we will not free it here */</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_asprintf(&filepath, "%s/%s", dir_path, files_dirent->d_name) < 0) {</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (stat(filepath, &statbuf))</span><br><span style="color: hsl(120, 100%, 40%);">+ if (stat(filepath, &statbuf) || !S_ISREG(statbuf.st_mode)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(filepath);</span><br><span> continue;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- if (!S_ISREG(statbuf.st_mode))</span><br><span style="color: hsl(0, 100%, 40%);">- continue;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> </span><br><span> if ((ext = strrchr(filepath, '.')))</span><br><span> *ext = '\0';</span><br><span> </span><br><span> /* if the file is present in multiple formats, ensure we only put it into the list once */</span><br><span style="color: hsl(0, 100%, 40%);">- if (AST_VECTOR_GET_CMP(&class->files, &filepath[0], !strcmp)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (AST_VECTOR_GET_CMP(&class->files, filepath, !strcmp)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(filepath);</span><br><span> continue;</span><br><span> }</span><br><span> </span><br><span> if (ast_test_flag(class, MOH_SORTALPHA)) {</span><br><span style="color: hsl(0, 100%, 40%);">- res = AST_VECTOR_ADD_SORTED(&class->files, ast_strdup(filepath), strcasecmp);</span><br><span style="color: hsl(120, 100%, 40%);">+ res = AST_VECTOR_ADD_SORTED(&class->files, filepath, strcasecmp);</span><br><span> } else {</span><br><span style="color: hsl(0, 100%, 40%);">- res = AST_VECTOR_APPEND(&class->files, ast_strdup(filepath));</span><br><span style="color: hsl(120, 100%, 40%);">+ res = AST_VECTOR_APPEND(&class->files, filepath);</span><br><span> }</span><br><span> </span><br><span> if (res) {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Adding to the vector failed, so it's our responsibility to clean up filepath */</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(filepath);</span><br><span> break;</span><br><span> }</span><br><span> }</span><br><span> </span><br><span> closedir(files_DIR);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free(dir_path);</span><br><span> </span><br><span> AST_VECTOR_COMPACT(&class->files);</span><br><span> </span><br><span>@@ -1365,6 +1404,7 @@</span><br><span> }</span><br><span> ao2_cleanup(state->origwfmt);</span><br><span> ao2_cleanup(state->mohwfmt);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_free_memory(state);</span><br><span> ast_free(state);</span><br><span> /* Only held a module reference if we had a music state */</span><br><span> ast_module_unref(ast_module_info->self);</span><br><span>@@ -1382,6 +1422,10 @@</span><br><span> class = __ao2_alloc(sizeof(*class), moh_class_destructor, AO2_ALLOC_OPT_LOCK_MUTEX,</span><br><span> "Allocating new moh class", file, line, funcname);</span><br><span> if (class) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (ast_string_field_init(class, MOH_CLASS_STRFIELD_INIT)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(class);</span><br><span style="color: hsl(120, 100%, 40%);">+ return NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> class->format = ao2_bump(ast_format_slin);</span><br><span> class->srcfd = -1;</span><br><span> class->kill_delay = 100000;</span><br><span>@@ -1461,7 +1505,7 @@</span><br><span> </span><br><span> if (ast_strlen_zero(mohclass->dir)) {</span><br><span> if (!strcasecmp(mohclass->mode, "custom")) {</span><br><span style="color: hsl(0, 100%, 40%);">- strcpy(mohclass->dir, "nodir");</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_set(mohclass, dir, "nodir");</span><br><span> } else {</span><br><span> ast_log(LOG_WARNING, "A directory must be specified for class '%s'!\n", mohclass->name);</span><br><span> mohclass = mohclass_unref(mohclass, "unreffing potential mohclass (no directory specified)");</span><br><span>@@ -1669,6 +1713,8 @@</span><br><span> </span><br><span> ao2_cleanup(class->format);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_free_memory(class);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Finally, collect the exit status of the monitor thread */</span><br><span> if (tid > 0) {</span><br><span> pthread_join(tid, NULL);</span><br><span>@@ -1752,11 +1798,11 @@</span><br><span> moh_parse_options(ast_variable_browse(cfg, cat), class);</span><br><span> /* For compatibility with the past, we overwrite any name=name</span><br><span> * with the context [name]. */</span><br><span style="color: hsl(0, 100%, 40%);">- ast_copy_string(class->name, cat, sizeof(class->name));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_set(class, name, cat);</span><br><span> </span><br><span> if (ast_strlen_zero(class->dir)) {</span><br><span> if (!strcasecmp(class->mode, "custom")) {</span><br><span style="color: hsl(0, 100%, 40%);">- strcpy(class->dir, "nodir");</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_string_field_set(class, dir, "nodir");</span><br><span> } else {</span><br><span> ast_log(LOG_WARNING, "A directory must be specified for class '%s'!\n", class->name);</span><br><span> class = mohclass_unref(class, "unreffing potential mohclass (no directory)");</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11660">change 11660</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/11660"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 17 </div>
<div style="display:none"> Gerrit-Change-Id: Icc6dd695cf254de2fc9968fa3bc7330c24cc7bb8 </div>
<div style="display:none"> Gerrit-Change-Number: 11660 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>