APACHE 2.0 STATUS: -*-text-*-
-Last modified at [$Date: 2003/12/14 00:26:12 $]
+Last modified at [$Date: 2003/12/14 00:50:20 $]
Release:
Yes, I think, a useful error message is better than
a coredump in this case.
- * More ab fixes; r1.129 fixes what looks like a trivial error in the
- SSL support; r1.130 adds some state-handling fixes related to
- ab's breakage in 2.0.47
- support/ab.c: r1.129, r1.130
- +1: trawick, brianp, ianh
-
* mod_rewrite: more or less cosmetic fix. If a .htaccess in DocumentRoot
configures:
RewriteBase /
/* good old state hostname */
#define STATE_UNCONNECTED 0
-#define STATE_CONNECTING 1
-#define STATE_READ 2
+#define STATE_CONNECTING 1 /* TCP connect initiated, but we don't
+ * know if it worked yet
+ */
+#define STATE_CONNECTED 2 /* we know TCP connect completed */
+#define STATE_READ 3
#define CBUFFSIZE (2048)
case SSL_ERROR_WANT_CONNECT:
BIO_printf(bio_err, "Waiting .. sleep(1)\n");
apr_sleep(apr_time_from_sec(1));
- c->state = STATE_CONNECTING;
+ c->state = STATE_CONNECTED;
c->rwrite = 0;
break;
case SSL_ERROR_ZERO_RETURN:
#ifdef USE_SSL
if (ssl != 1)
+#endif
if (e != APR_SUCCESS) {
/*
* Let's hope this traps EWOULDBLOCK too !
}
return;
}
-#endif
c->rwrote += l;
c->rwrite -= l;
} while (1);
c->state = STATE_CONNECTING;
c->rwrite = 0;
new_pollfd.desc_type = APR_POLL_SOCKET;
- new_pollfd.reqevents = APR_POLLOUT | APR_POLLIN;
+ new_pollfd.reqevents = APR_POLLOUT;
new_pollfd.desc.s = c->aprsock;
new_pollfd.client_data = c;
apr_pollset_add(readbits, &new_pollfd);
}
/* connected first time */
+ c->state = STATE_CONNECTED;
started++;
write_request(c);
}
start_connect(c);
continue;
}
- if (rv & APR_POLLOUT)
- write_request(c);
+ if (rv & APR_POLLOUT) {
+ if (c->state == STATE_CONNECTING) {
+ apr_pollfd_t remove_pollfd;
+ rv = apr_connect(c->aprsock, destsa);
+ remove_pollfd.desc_type = APR_POLL_SOCKET;
+ remove_pollfd.desc.s = c->aprsock;
+ apr_pollset_remove(readbits, &remove_pollfd);
+ if (rv != APR_SUCCESS) {
+ apr_socket_close(c->aprsock);
+ err_conn++;
+ if (bad++ > 10) {
+ fprintf(stderr,
+ "\nTest aborted after 10 failures\n\n");
+ apr_err("apr_connect()", rv);
+ }
+ c->state = STATE_UNCONNECTED;
+ start_connect(c);
+ continue;
+ }
+ else {
+ c->state = STATE_CONNECTED;
+ write_request(c);
+ }
+ }
+ else {
+ write_request(c);
+ }
+ }
/*
* When using a select based poll every time we check the bits
#ifdef USE_SSL
if (ssl != 1)
#endif
- if (c->state == STATE_READ ||
- c->state == STATE_CONNECTING) {
+ if (c->state == STATE_READ) {
apr_pollfd_t new_pollfd;
new_pollfd.desc_type = APR_POLL_SOCKET;
new_pollfd.reqevents = APR_POLLIN;
static void copyright(void)
{
if (!use_html) {
- printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.121.2.4 $> apache-2.0");
+ printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.121.2.5 $> apache-2.0");
printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
printf("Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/\n");
printf("\n");
}
else {
printf("<p>\n");
- printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.121.2.4 $");
+ printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AP_AB_BASEREVISION, "$Revision: 1.121.2.5 $");
printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
printf(" Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/<br>\n");
printf("</p>\n<p>\n");