Changeset 343

Show
Ignore:
Timestamp:
05/05/2005 08:15:05 AM (3 years ago)
Author:
jan
Message:

remove FDEVENT_OUT as soon as we hit _READ and only call joblist_append() if really needed

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.3.x/src/mod_fastcgi.c

    r318 r343  
    751751                /* create socket */ 
    752752                if (-1 == bind(fcgi_fd, fcgi_addr, servlen)) { 
    753                         log_error_write(srv, __FILE__, __LINE__, "ss",  
    754                                 "bind failed:", strerror(errno)); 
     753                        log_error_write(srv, __FILE__, __LINE__, "sbds",  
     754                                "bind failed for:",  
     755                                proc->socket,  
     756                                proc->port,  
     757                                strerror(errno)); 
    755758                        return -1; 
    756759                } 
     
    23612364        /* sanity check */       
    23622365        if (!host || 
    2363             ((!host->host->used || !host->port) && !host->unixsocket->used)) return HANDLER_ERROR; 
    2364          
     2366            ((!host->host->used || !host->port) && !host->unixsocket->used)) { 
     2367                log_error_write(srv, __FILE__, __LINE__, "sxddd",  
     2368                                "write-req: error", 
     2369                                host, 
     2370                                host->host->used, 
     2371                                host->port, 
     2372                                host->unixsocket->used); 
     2373                return HANDLER_ERROR; 
     2374        } 
     2375         
     2376 
    23652377        switch(hctx->state) { 
    23662378        case FCGI_STATE_INIT: 
     
    25472559                 
    25482560                if (hctx->write_offset == hctx->write_buffer->used) { 
     2561                        /* we don't need the out event anymore */ 
     2562                        fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd); 
     2563                        fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN); 
    25492564                        fcgi_set_state(srv, hctx, FCGI_STATE_READ); 
    25502565                } 
     
    25532568        case FCGI_STATE_READ: 
    25542569                /* waiting for a response */ 
    2555                  
    2556                 fdevent_event_add(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN); 
    2557                  
    25582570                break; 
    25592571        default: 
     
    26572669                return HANDLER_WAIT_FOR_FD; 
    26582670        default: 
     2671                log_error_write(srv, __FILE__, __LINE__, "s", "subrequest write-req default"); 
    26592672                return HANDLER_ERROR; 
    26602673        } 
     
    26942707        fcgi_extension_host *host= hctx->host; 
    26952708 
    2696         joblist_append(srv, con); 
    2697          
    26982709        if ((revents & FDEVENT_IN) && 
    26992710            hctx->state == FCGI_STATE_READ) { 
     
    27252736                        } 
    27262737                         
     2738                        joblist_append(srv, con); 
    27272739                        return HANDLER_FINISHED; 
    27282740                case -1: 
     
    28062818                         
    28072819                         
     2820                        joblist_append(srv, con); 
    28082821                        return HANDLER_FINISHED; 
    28092822                } 
     
    28592872                        connection_set_state(srv, con, CON_STATE_ERROR); 
    28602873                        fcgi_connection_close(srv, hctx); 
     2874                        joblist_append(srv, con); 
    28612875                } 
    28622876        } else if (revents & FDEVENT_ERR) { 
     
    28682882                connection_set_state(srv, con, CON_STATE_ERROR); 
    28692883                fcgi_connection_close(srv, hctx); 
     2884                joblist_append(srv, con); 
    28702885        } 
    28712886