@@ -215,12 +215,13 @@ backend_reschedule(Channel* chan, bool is_new)
215
215
static size_t
216
216
string_length (char const * str )
217
217
{
218
- size_t length ;
219
- if (str == NULL )
218
+ size_t spaces = 0 ;
219
+ char const * p = str ;
220
+ if (p == NULL )
220
221
return 0 ;
221
- while (* str != '\0' )
222
- length += (* str ++ == ' ' ) ? 2 : 1 ;
223
- return length ;
222
+ while (* p != '\0' )
223
+ spaces += (* p ++ == ' ' );
224
+ return ( p - str ) + spaces ;
224
225
}
225
226
226
227
static size_t
@@ -371,8 +372,8 @@ client_connect(Channel* chan, int startup_packet_size)
371
372
if (!string_list_equal (chan -> pool -> startup_gucs , chan -> client_port -> guc_options ) ||
372
373
!string_equal (chan -> pool -> cmdline_options , chan -> client_port -> cmdline_options ))
373
374
{
374
- elog (LOG , "Ignoring GUCs of client %s:%s " ,
375
- NULLSTR (chan -> client_port -> remote_host ), NULLSTR ( chan -> client_port -> remote_port ));
375
+ elog (LOG , "Ignoring GUCs of client %s" ,
376
+ NULLSTR (chan -> client_port -> application_name ));
376
377
}
377
378
}
378
379
}
@@ -941,7 +942,7 @@ backend_start(SessionPool* pool, char** error)
941
942
{
942
943
Channel * chan ;
943
944
char postmaster_port [8 ];
944
- char * options = (char * )palloc (string_length (pool -> cmdline_options ) + string_list_length (pool -> startup_gucs ) + list_length (pool -> startup_gucs )* 5 + 1 );
945
+ char * options = (char * )palloc (string_length (pool -> cmdline_options ) + string_list_length (pool -> startup_gucs ) + list_length (pool -> startup_gucs )/ 2 * 5 + 1 );
945
946
char const * keywords [] = {"port" ,"dbname" ,"user" ,"sslmode" ,"application_name" ,"options" ,NULL };
946
947
char const * values [] = {postmaster_port ,pool -> key .database ,pool -> key .username ,"disable" ,"pool_worker" ,options ,NULL };
947
948
PGconn * conn ;
@@ -982,7 +983,6 @@ backend_start(SessionPool* pool, char** error)
982
983
}
983
984
}
984
985
* dst = '\0' ;
985
- elog (LOG , "Spawn backend with parameters \"%s\"" , options );
986
986
conn = LibpqConnectdbParams (keywords , values , error );
987
987
pfree (options );
988
988
if (!conn )
0 commit comments