@@ -141,6 +141,7 @@ ngx_rtmp_auto_push_init_process(ngx_cycle_t *cycle)
141
141
ngx_socket_t s ;
142
142
size_t n ;
143
143
ngx_file_info_t fi ;
144
+ ngx_pid_t pid ;
144
145
145
146
if (ngx_process != NGX_PROCESS_WORKER ) {
146
147
return NGX_OK ;
@@ -197,9 +198,10 @@ ngx_rtmp_auto_push_init_process(ngx_cycle_t *cycle)
197
198
return NGX_ERROR ;
198
199
}
199
200
saun -> sun_family = AF_UNIX ;
201
+ pid = ngx_getpid ();
200
202
* ngx_snprintf ((u_char * ) saun -> sun_path , sizeof (saun -> sun_path ),
201
203
"%V/" NGX_RTMP_AUTO_PUSH_SOCKNAME ".%i" ,
202
- & apcf -> socket_dir , ngx_process_slot )
204
+ & apcf -> socket_dir , pid )
203
205
= 0 ;
204
206
205
207
ngx_log_debug1 (NGX_LOG_DEBUG_RTMP , cycle -> log , 0 ,
@@ -352,6 +354,7 @@ ngx_rtmp_auto_push_exit_process(ngx_cycle_t *cycle)
352
354
ngx_listening_t * ls ;
353
355
ngx_connection_t * c ;
354
356
size_t n ;
357
+ ngx_pid_t pid ;
355
358
356
359
apcf = (ngx_rtmp_auto_push_conf_t * ) ngx_get_conf (cycle -> conf_ctx ,
357
360
ngx_rtmp_auto_push_module );
@@ -398,9 +401,10 @@ ngx_rtmp_auto_push_exit_process(ngx_cycle_t *cycle)
398
401
}
399
402
}
400
403
404
+ pid = ngx_getpid ();
401
405
* ngx_snprintf (path , sizeof (path ),
402
406
"%V/" NGX_RTMP_AUTO_PUSH_SOCKNAME ".%i" ,
403
- & apcf -> socket_dir , ngx_process_slot )
407
+ & apcf -> socket_dir , pid )
404
408
= 0 ;
405
409
406
410
ngx_delete_file (path );
@@ -513,7 +517,7 @@ ngx_rtmp_auto_push_reconnect(ngx_event_t *ev)
513
517
u = & at .url .url ;
514
518
p = ngx_snprintf (path , sizeof (path ) - 1 ,
515
519
"unix:%V/" NGX_RTMP_AUTO_PUSH_SOCKNAME ".%i" ,
516
- & apcf -> socket_dir , n );
520
+ & apcf -> socket_dir , pid );
517
521
* p = 0 ;
518
522
519
523
if (ngx_file_info (path + sizeof ("unix:" ) - 1 , & fi ) != NGX_OK ) {
0 commit comments