@@ -141,6 +141,7 @@ ngx_rtmp_auto_push_init_process(ngx_cycle_t *cycle)
141141 ngx_socket_t s ;
142142 size_t n ;
143143 ngx_file_info_t fi ;
144+ ngx_pid_t pid ;
144145
145146 if (ngx_process != NGX_PROCESS_WORKER ) {
146147 return NGX_OK ;
@@ -197,9 +198,10 @@ ngx_rtmp_auto_push_init_process(ngx_cycle_t *cycle)
197198 return NGX_ERROR ;
198199 }
199200 saun -> sun_family = AF_UNIX ;
201+ pid = ngx_getpid ();
200202 * ngx_snprintf ((u_char * ) saun -> sun_path , sizeof (saun -> sun_path ),
201203 "%V/" NGX_RTMP_AUTO_PUSH_SOCKNAME ".%i" ,
202- & apcf -> socket_dir , ngx_process_slot )
204+ & apcf -> socket_dir , pid )
203205 = 0 ;
204206
205207 ngx_log_debug1 (NGX_LOG_DEBUG_RTMP , cycle -> log , 0 ,
@@ -352,6 +354,7 @@ ngx_rtmp_auto_push_exit_process(ngx_cycle_t *cycle)
352354 ngx_listening_t * ls ;
353355 ngx_connection_t * c ;
354356 size_t n ;
357+ ngx_pid_t pid ;
355358
356359 apcf = (ngx_rtmp_auto_push_conf_t * ) ngx_get_conf (cycle -> conf_ctx ,
357360 ngx_rtmp_auto_push_module );
@@ -398,9 +401,10 @@ ngx_rtmp_auto_push_exit_process(ngx_cycle_t *cycle)
398401 }
399402 }
400403
404+ pid = ngx_getpid ();
401405 * ngx_snprintf (path , sizeof (path ),
402406 "%V/" NGX_RTMP_AUTO_PUSH_SOCKNAME ".%i" ,
403- & apcf -> socket_dir , ngx_process_slot )
407+ & apcf -> socket_dir , pid )
404408 = 0 ;
405409
406410 ngx_delete_file (path );
@@ -513,7 +517,7 @@ ngx_rtmp_auto_push_reconnect(ngx_event_t *ev)
513517 u = & at .url .url ;
514518 p = ngx_snprintf (path , sizeof (path ) - 1 ,
515519 "unix:%V/" NGX_RTMP_AUTO_PUSH_SOCKNAME ".%i" ,
516- & apcf -> socket_dir , n );
520+ & apcf -> socket_dir , pid );
517521 * p = 0 ;
518522
519523 if (ngx_file_info (path + sizeof ("unix:" ) - 1 , & fi ) != NGX_OK ) {
0 commit comments