On 27 Jan 2022, at 09:53, Ruediger Pluem <rpl...@apache.org> wrote:

>> Modified: httpd/httpd/trunk/support/ab.c
>> URL: 
>> http://svn.apache.org/viewvc/httpd/httpd/trunk/support/ab.c?rev=1897458&r1=1897457&r2=1897458&view=diff
>>  
>> <http://svn.apache.org/viewvc/httpd/httpd/trunk/support/ab.c?rev=1897458&r1=1897457&r2=1897458&view=diff>
>> ==============================================================================
>> --- httpd/httpd/trunk/support/ab.c (original)
>> +++ httpd/httpd/trunk/support/ab.c Tue Jan 25 15:54:22 2022
> 
>> @@ -810,9 +811,6 @@ static void ssl_proceed_handshake(struct
>> 
>> static void write_request(struct connection * c)
>> {
>> -    if (started >= requests) {
>> -        return;
>> -    }
> 
> Why is this no longer needed?

It’s in the wrong place, this has been moved one level up. 

>>     do {
>>         apr_time_t tnow;
> 
>> @@ -1461,7 +1465,6 @@ static void start_connect(struct connect
>>     }
>> 
>>     /* connected first time */
>> -    set_conn_state(c, STATE_CONNECTED);
> 
> Why don't we set the state to connected any longer?
> 
>> #ifdef USE_SSL
>>     if (c->ssl) {
>>         ssl_proceed_handshake(c);

…because directly after being set, ssl_proceed_handshake() or read_connection() 
sets the state to something else.

Part of the confusion is that these states represent how the code needs to 
react after the poll. It seems in a number of places they were being set 
arbitrarily where it didn’t make sense.

>> @@ -1786,7 +1799,7 @@ read_more:
>>         c->read = c->bread = 0;
>>         /* zero connect time with keep-alive */
>>         c->start = c->connect = lasttime = apr_time_now();
>> -        set_conn_state(c, STATE_CONNECTED);
> 
> Why don't we set the state to connected any longer?
> 
>> +
>>         write_request(c);

Again, directly after being set, write_request() sets it to something else.

>>     }
>> }
> 
>> @@ -2048,7 +2077,7 @@ static void test(void)
>>                         continue;
>>                     }
>>                     else {
>> -                        set_conn_state(c, STATE_CONNECTED);
> 
> Why don't we set the state to connected any longer?
> 
>> +
>> #ifdef USE_SSL
>>                         if (c->ssl)
>>                             ssl_proceed_handshake(c);

Same reason as above.

Regards,
Graham
—

Reply via email to