Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 82032 Details for
Bug 125157
asterisk 1.2.4 causes festival 1.4.3-r3 to go into infinite loop and lockup system
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
reimplementation of the main loop based on select()
festival-1.4.3-waitpid_endlessloop_select.diff (text/plain), 2.35 KB, created by
Stefan Knoblich (RETIRED)
on 2006-03-13 13:07:29 UTC
(
hide
)
Description:
reimplementation of the main loop based on select()
Filename:
MIME Type:
Creator:
Stefan Knoblich (RETIRED)
Created:
2006-03-13 13:07:29 UTC
Size:
2.35 KB
patch
obsolete
>--- festival/src/arch/festival/server.cc.orig 2006-03-07 15:47:37.000000000 +0100 >+++ festival/src/arch/festival/server.cc 2006-03-07 15:50:04.000000000 +0100 >@@ -148,49 +148,65 @@ int festival_start_server(int port) > > while(1) // never exits except by signals > { >- if((fd1 = accept(fd, 0, 0)) < 0) >- { >- cerr << "socket: accept failed"; >- festival_error(); >- } >+#ifndef SINGLE_CLIENT >+ struct timeval timeout; >+ timeout.tv_sec = 10L; // 10 second timeout >+ timeout.tv_usec = 0L; >+ >+ fd_set fds; >+ FD_ZERO(&fds); >+ FD_SET(fd, &fds); > >- client_name++; >- if (client_access_check(fd1,client_name) == FALSE) >+ if(select(fd + 1, &fds, NULL, NULL, &timeout) > 0) // fd has changed, process request > { >- close(fd1); >- continue; >- } >+#endif >+ if((fd1 = accept(fd, 0, 0)) < 0) >+ { >+ cerr << "socket: accept failed"; >+ festival_error(); >+ } >+ >+ client_name++; >+ if (client_access_check(fd1,client_name) == FALSE) >+ { >+ close(fd1); >+ continue; >+ } > #ifdef SINGLE_CLIENT >- ft_server_socket = fd1; >- repl_from_socket(fd1); >- log_message(client_name,"disconnected"); >-#else >- num_clients++; >- >- // Fork new image of festival and call interpreter >- if (num_clients > max_clients) >- { >- log_message(client_name,"failed: too many clients"); >- num_clients--; >- } >- else if ((pid=fork()) == 0) >- { > ft_server_socket = fd1; > repl_from_socket(fd1); > log_message(client_name,"disconnected"); >- exit(0); >- } >- else if (pid < 0) >- { >- log_message(client_name,"failed to fork new client"); >- num_clients--; >+ close(fd1); >+#else >+ num_clients++; >+ >+ // Fork new image of festival and call interpreter >+ if (num_clients > max_clients) >+ { >+ log_message(client_name,"failed: too many clients"); >+ num_clients--; >+ close(fd1); >+ } >+ else if ((pid=fork()) == 0) >+ { >+ ft_server_socket = fd1; >+ repl_from_socket(fd1); >+ log_message(client_name,"disconnected"); >+ close(fd1); >+ exit(0); >+ } >+ else if (pid < 0) >+ { >+ log_message(client_name,"failed to fork new client"); >+ num_clients--; >+ close(fd1); >+ } > } > >- while (waitpid(0,&statusp,WNOHANG) != 0) >+ while (waitpid(0,&statusp,WNOHANG) > 0) > num_clients--; >-#endif > >- close(fd1); >+#endif > } > > return 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 125157
:
81569
|
81571
| 82032