[asterisk-dev] proposed change to main/http.c

Luigi Rizzo rizzo at icir.org
Fri Oct 6 09:53:18 MST 2006


On Fri, Oct 06, 2006 at 11:19:17AM -0500, Kevin P. Fleming wrote:
> ----- Luigi Rizzo <rizzo at icir.org> wrote:
> > It shouldn't harm on linux either, as the socket should really
> > be blocking to make input processing correct and efficient
> 
> I don't understand why the main socket used here is non-blocking at all; it makes no sense. If it wasn't, then the sub-sockets created by accept() would be blocking by default, and everything would be happy.

> I'll go ask Mark (somewhat politely) what he was thinking :-)

indeed, i don't understand why there are calls cwto set non-blocking mode
all over the place. I think many of these are useless if not wrong.

> grep -r NONBLOCK . | manually_filter_out_non_relevant_cases

./codecs/codec_zap.c:           if (fcntl(fd, F_SETFL, flags | O_NONBLOCK))
./agi/eagi-sphinx-test.c:       if ((res < 0) || (fcntl(sphinx_sock, F_SETFL, res | O_NONBLOCK) < 0)) {
./res/res_agi.c:        if (fcntl(s, F_SETFL, flags | O_NONBLOCK) < 0) {
./res/res_agi.c:                        res = fcntl(audio[1], F_SETFL, res | O_NONBLOCK);
./res/res_musiconhold.c:        fcntl(moh->pipe[0], F_SETFL, flags | O_NONBLOCK);
./res/res_musiconhold.c:        fcntl(moh->pipe[1], F_SETFL, flags | O_NONBLOCK);
./channels/chan_phone.c:                fcntl(tmp->fd, F_SETFL, flags | O_NONBLOCK);
./apps/app_meetme.c:            if (fcntl(fd, F_SETFL, flags | O_NONBLOCK)) {
./apps/app_ices.c:      fcntl(fds[1], F_SETFL, flags | O_NONBLOCK);
./apps/app_zapbarge.c:          if (fcntl(fd, F_SETFL, flags | O_NONBLOCK)) {
./apps/app_zapscan.c:           if (fcntl(fd, F_SETFL, flags | O_NONBLOCK)) {
./main/channel.c:                       fcntl(tmp->alertpipe[0], F_SETFL, flags | O_NONBLOCK);
./main/channel.c:                       fcntl(tmp->alertpipe[1], F_SETFL, flags | O_NONBLOCK);
./main/manager.c:                       fcntl(as, F_SETFL, flags | O_NONBLOCK);
./main/manager.c:                       fcntl(as, F_SETFL, flags & ~O_NONBLOCK);
./main/manager.c:               fcntl(asock, F_SETFL, flags | O_NONBLOCK);
./main/http.c:                  fcntl(fd, F_SETFL, flags & ~O_NONBLOCK);
./main/http.c:  fcntl(httpfd, F_SETFL, flags | O_NONBLOCK);
./main/rtp.c:           fcntl(s, F_SETFL, flags | O_NONBLOCK);
./main/asterisk.c:                                      fcntl(consoles[x].p[1], F_SETFL, flags | O_NONBLOCK);
./main/udptl.c: fcntl(udptl->fd, F_SETFL, flags | O_NONBLOCK);

	cheers
	luigi


More information about the asterisk-dev mailing list