@@ -1155,7 +1155,12 @@ ngx_stream_upsync_consul_parse_json(void *data)
1155
1155
cJSON * temp1 = cJSON_GetObjectItem (server_next , "Key" );
1156
1156
if (temp1 != NULL && temp1 -> valuestring != NULL ) {
1157
1157
p = (u_char * )ngx_strrchr (temp1 -> valuestring , '/' );
1158
- if (p == NULL || ngx_stream_upsync_check_key (p ) != NGX_OK ) {
1158
+ if (p == NULL ) {
1159
+ ngx_log_error (NGX_LOG_ERR , ngx_cycle -> log , 0 ,
1160
+ "upsync_parse_json: %s key format is illegal, "
1161
+ "contains no slash ('/')" , temp1 -> valuestring );
1162
+ continue ;
1163
+ } else if (ngx_stream_upsync_check_key (p ) != NGX_OK ) {
1159
1164
continue ;
1160
1165
}
1161
1166
@@ -1389,7 +1394,12 @@ ngx_stream_upsync_etcd_parse_json(void *data)
1389
1394
cJSON * temp0 = cJSON_GetObjectItem (server_next , "key" );
1390
1395
if (temp0 != NULL && temp0 -> valuestring != NULL ) {
1391
1396
p = (u_char * )ngx_strrchr (temp0 -> valuestring , '/' );
1392
- if (p == NULL || ngx_stream_upsync_check_key (p ) != NGX_OK ) {
1397
+ if (p == NULL ) {
1398
+ ngx_log_error (NGX_LOG_ERR , ngx_cycle -> log , 0 ,
1399
+ "upsync_parse_json: %s key format is illegal, "
1400
+ "contains no slash ('/')" , temp0 -> valuestring );
1401
+ continue ;
1402
+ } else if (ngx_stream_upsync_check_key (p ) != NGX_OK ) {
1393
1403
continue ;
1394
1404
}
1395
1405
0 commit comments