ASF Bugzilla – Attachment 15653 Details for
Bug 35702
Using with https URL, ab freezes or gets SIGSEGV on 2.1.6-alpha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Path for ab in httpd 2.1.6-alpha
ab-patch.txt (text/plain), 6.79 KB, created by
Masaoki Kobayashi
on 2005-07-12 13:45:25 UTC
(
hide
)
Description:
Path for ab in httpd 2.1.6-alpha
Filename:
MIME Type:
Creator:
Masaoki Kobayashi
Created:
2005-07-12 13:45:25 UTC
Size:
6.79 KB
patch
obsolete
>--- httpd-2.1.6-alpha/support/ab.c 2005-05-18 00:34:43.000000000 +0900 >+++ httpd-2.1.6-alpha.new/support/ab.c 2005-07-12 19:27:37.461352000 +0900 >@@ -80,6 +80,10 @@ > ** Switched to the new abstract pollset API, allowing ab to > ** take advantage of future apr_pollset_t scalability improvements. > ** Contributed by Brian Pane, August 31, 2002 >+ ** >+ ** Version 2.1.7-dev >+ ** New SSL code by Masaoki Kobayashi <masaoki@techfirm.co.jp>, >+ ** enables the asynchronous I/O also under SSL connections. > **/ > > /* Note: this version string should start with \d+[\d\.]* and be a valid >@@ -91,7 +95,7 @@ > * ab - or to due to a change in the distribution it is compiled with > * (such as an APR change in for example blocking). > */ >-#define AP_AB_BASEREVISION "2.0.40-dev" >+#define AP_AB_BASEREVISION "2.1.7-dev" > > /* > * BUGS: >@@ -234,6 +238,7 @@ > int socknum; > #ifdef USE_SSL > SSL *ssl; >+ int ssl_polling; > #endif > }; > >@@ -403,11 +408,13 @@ > (w & SSL_CB_READ ? "read" : "write"), > SSL_alert_type_string_long(r), > SSL_alert_desc_string_long(r)); >- } else if (w & SSL_CB_LOOP) { >+ } >+ else if (w & SSL_CB_LOOP) { > BIO_printf(bio_err, "SSL/TLS State [%s] %s\n", > (SSL_in_connect_init((SSL*)s) ? "connect" : "-"), > SSL_state_string_long(s)); >- } else if (w & (SSL_CB_HANDSHAKE_START|SSL_CB_HANDSHAKE_DONE)) { >+ } >+ else if (w & (SSL_CB_HANDSHAKE_START|SSL_CB_HANDSHAKE_DONE)) { > BIO_printf(bio_err, "SSL/TLS Handshake [%s] %s\n", > (w & SSL_CB_HANDSHAKE_START ? "Start" : "Done"), > SSL_state_string_long(s)); >@@ -528,7 +535,8 @@ > cert = SSL_get_peer_certificate(c->ssl); > if (cert == NULL) { > BIO_printf(bio_out, "Anon DH\n"); >- } else { >+ } >+ else { > BIO_printf(bio_out, "Peer certificate\n"); > ssl_print_cert_info(bio_out, cert); > X509_free(cert); >@@ -543,7 +551,6 @@ > > while (do_next) { > int ret, ecode; >- apr_pollfd_t new_pollfd; > > ret = SSL_do_handshake(c->ssl); > ecode = SSL_get_error(c->ssl, ret); >@@ -575,11 +582,15 @@ > do_next = 0; > break; > case SSL_ERROR_WANT_READ: >- new_pollfd.desc_type = APR_POLL_SOCKET; >- new_pollfd.reqevents = APR_POLLIN; >- new_pollfd.desc.s = c->aprsock; >- new_pollfd.client_data = c; >- apr_pollset_add(readbits, &new_pollfd); >+ if (!c->ssl_polling) { >+ apr_pollfd_t new_pollfd; >+ new_pollfd.desc_type = APR_POLL_SOCKET; >+ new_pollfd.reqevents = APR_POLLIN; >+ new_pollfd.desc.s = c->aprsock; >+ new_pollfd.client_data = c; >+ apr_pollset_add(readbits, &new_pollfd); >+ c->ssl_polling = 1; >+ } > do_next = 0; > break; > case SSL_ERROR_WANT_WRITE: >@@ -666,6 +677,11 @@ > totalposted += c->rwrite; > c->state = STATE_READ; > c->endwrite = apr_time_now(); >+#ifdef USE_SSL >+ /* Do not add the pollset here in ssl connection which is >+ already been polling */ >+ if (!c->ssl_polling) >+#endif > { > apr_pollfd_t new_pollfd; > new_pollfd.desc_type = APR_POLL_SOCKET; >@@ -1135,6 +1151,7 @@ > ERR_print_errors(bio_err); > exit(1); > } >+ c->ssl_polling = 0; > ssl_rand_seed(); > apr_os_sock_get(&fd, c->aprsock); > bio = BIO_new_socket(fd, BIO_NOCLOSE); >@@ -1144,8 +1161,10 @@ > BIO_set_callback(bio, ssl_print_cb); > BIO_set_callback_arg(bio, bio_err); > } >- } else { >+ } >+ else { > c->ssl = NULL; >+ c->ssl_polling = 0; > } > #endif > if ((rv = apr_socket_connect(c->aprsock, destsa)) != APR_SUCCESS) { >@@ -1184,7 +1203,8 @@ > #ifdef USE_SSL > if (c->ssl) { > ssl_proceed_handshake(c); >- } else >+ } >+ else > #endif > { > write_request(c); >@@ -1693,22 +1713,6 @@ > write_request(c); > } > } >- >- /* >- * When using a select based poll every time we check the bits >- * are reset. In 1.3's ab we copied the FD_SET's each time >- * through, but here we're going to check the state and if the >- * connection is in STATE_READ or STATE_CONNECTING we'll add the >- * socket back in as APR_POLLIN. >- */ >- if (c->state == STATE_READ) { >- apr_pollfd_t new_pollfd; >- new_pollfd.desc_type = APR_POLL_SOCKET; >- new_pollfd.reqevents = APR_POLLIN; >- new_pollfd.desc.s = c->aprsock; >- new_pollfd.client_data = c; >- apr_pollset_add(readbits, &new_pollfd); >- } > } > } > >@@ -1729,14 +1733,14 @@ > static void copyright(void) > { > if (!use_html) { >- printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " <$Revision: 1.146 $> apache-2.0"); >+ printf("This is ApacheBench, Version %s\n", AP_AB_BASEREVISION " apache-2.1"); > printf("Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n"); > printf("Copyright 1997-2005 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.146 $"); >+ printf(" This is ApacheBench, Version %s apache-2.1<br>\n", AP_AB_BASEREVISION); > printf(" Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n"); > printf(" Copyright 1997-2005 The Apache Software Foundation, http://www.apache.org/<br>\n"); > printf("</p>\n<p>\n"); >@@ -1852,7 +1856,8 @@ > (port != 80))) > { > colonhost = apr_psprintf(cntxt,":%d",port); >- } else >+ } >+ else > colonhost = ""; > return 0; > } >@@ -2082,11 +2087,14 @@ > case 'f': > if (strncasecmp(optarg, "ALL", 3) == 0) { > meth = SSLv23_client_method(); >- } else if (strncasecmp(optarg, "SSL2", 4) == 0) { >+ } >+ else if (strncasecmp(optarg, "SSL2", 4) == 0) { > meth = SSLv2_client_method(); >- } else if (strncasecmp(optarg, "SSL3", 4) == 0) { >+ } >+ else if (strncasecmp(optarg, "SSL3", 4) == 0) { > meth = SSLv3_client_method(); >- } else if (strncasecmp(optarg, "TLS1", 4) == 0) { >+ } >+ else if (strncasecmp(optarg, "TLS1", 4) == 0) { > meth = TLSv1_client_method(); > } > break;
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 35702
: 15653