Connection time out problems
am 10.06.2005 17:39:46 von BrianI have a case where a https connection times out, which causes an alarm=20=
to trigger, apache start shutting down and mod_ssl tries to flush the=20
buffer in a non-blocking way and hangs the connection until restart=20
(see the backtrace below).
I think the cause of this is the http_main.c patch for EAPI (see below)=20=
because it inserts the ap_call_close_connection_hook before setting=20
B_EOUT instead of after. If it would set B_OUT first and then call=20
ap_call_close_connection_hook, any ap_bflush or ap_bwrite calls would=20
return (-1) instead of trying to write data to the socket (in a=20
non-blocking way).
Thoughts?
Thanks,
Brian
--------
@@ -1541,6 +1568,10 @@
ap_log_transaction(log_req);
}
+#ifdef EAPI
+ ap_call_close_connection_hook(save_req->connection);
+#endif /* EAPI */
+
ap_bsetflag(save_req->connection->client, B_EOUT, 1);
ap_bclose(save_req->connection->client);
@@ -1549,6 +1580,9 @@
ap_longjmp(jmpbuffer, 1);
}
else { /* abort the connection */
+#ifdef EAPI
+ ap_call_close_connection_hook(current_conn);
+#endif /* EAPI */
ap_bsetflag(current_conn->client, B_EOUT, 1);
ap_bclose(current_conn->client);
current_conn->aborted =3D 1;
--------
#0 0x20307a20 in write () from /usr/lib/libc.so.4
#1 0x20220456 in sock_write () from /home/y/lib/libcrypto.so
#2 0x2021e5cf in BIO_write () from /home/y/lib/libcrypto.so
#3 0x201bc503 in ssl3_write_pending () from /home/y/lib/libssl.so
#4 0x201bc26a in do_ssl3_write () from /home/y/lib/libssl.so
#5 0x201bc1e2 in ssl3_write_bytes () from /home/y/lib/libssl.so
#6 0x201ba665 in ssl3_write () from /home/y/lib/libssl.so
#7 0x201c1b92 in SSL_write () from /home/y/lib/libssl.so
#8 0x3b7d6 in ssl_io_hook_write (fb=3D0x267044, buf=3D0x2e900c=20
"
#9 0x67741 in ap_hook_call_func (ap=3D0x9fbfb404 "4´¿\237Dp&",=20
he=3D0xa5080, hf=3D0xa7110) at ap_hook.c:649
#10 0x673f6 in ap_hook_call (hook=3D0x7c0e4 "ap::buff::write") at=20
ap_hook.c:382
#11 0x48b1e in ap_write (fb=3D0x267044, buf=3D0x2e900c, nbyte=3D4096) at=20=
buff.c:336
#12 0x49676 in write_with_errors (fb=3D0x267044, buf=3D0x2e900c,=20
nbyte=3D4096) at buff.c:391
#13 0x49f72 in bflush_core (fb=3D0x267044) at buff.c:1760
#14 0x49ffa in ap_bflush (fb=3D0x267044) at buff.c:1805
#15 0x393f3 in ssl_hook_CloseConnection (conn=3D0xc8068) at=20
ssl_engine_kernel.c:474
#16 0x525f6 in ap_call_close_connection_hook (c=3D0xc8068) at=20
http_main.c:523
#17 0x52ea7 in timeout (sig=3D14) at http_main.c:1738
#18 0x52fcc in alrm_handler (sig=3D14) at http_main.c:1812
#19 0x9fbfffac in ?? ()
#20 0x2021e5cf in BIO_write () from /home/y/lib/libcrypto.so
#21 0x201bc503 in ssl3_write_pending () from /home/y/lib/libssl.so
#22 0x201bc440 in do_ssl3_write () from /home/y/lib/libssl.so
#23 0x201bc1e2 in ssl3_write_bytes () from /home/y/lib/libssl.so
#24 0x201ba665 in ssl3_write () from /home/y/lib/libssl.so
#25 0x201c1b92 in SSL_write () from /home/y/lib/libssl.so
#26 0x3b7d6 in ssl_io_hook_write (fb=3D0x267044, buf=3D0x2e900c=20
"
#27 0x67741 in ap_hook_call_func (ap=3D0x9fbfb930 "`¹¿\237Dp&",=20
he=3D0xa5080, hf=3D0xa7110) at ap_hook.c:649
#28 0x673f6 in ap_hook_call (hook=3D0x7c0e4 "ap::buff::write") at=20
ap_hook.c:382
#29 0x48b1e in ap_write (fb=3D0x267044, buf=3D0x2e900c, nbyte=3D4096) at=20=
buff.c:336
#30 0x49676 in write_with_errors (fb=3D0x267044, buf=3D0x2e900c,=20
nbyte=3D4096) at buff.c:391
#31 0x49f72 in bflush_core (fb=3D0x267044) at buff.c:1760
#32 0x49ffa in ap_bflush (fb=3D0x267044) at buff.c:1805
< internal code frames removed >
#38 0x4ac04 in ap_invoke_handler (r=3D0x1ef034) at http_config.c:479
#39 0x5d0ac in process_request_internal (r=3D0x1ef034) at=20
http_request.c:1366
#40 0x5d107 in ap_process_request (r=3D0x1ef034) at http_request.c:1382
#41 0x556ba in child_main (child_num_arg=3D87) at http_main.c:5388
#42 0x559ad in make_child (s=3D0x9c2e8, slot=3D87, now=3D1118326412) at=20=
http_main.c:5629
#43 0x55c38 in perform_idle_server_maintenance () at http_main.c:5853
#44 0x5617a in standalone_main (argc=3D11, argv=3D0x9fbff028) at=20
http_main.c:6165
#45 0x5671c in main (argc=3D11, argv=3D0x9fbff028) at http_main.c:6448
____________________________________________________________ __________
Apache Interface to OpenSSL (mod_ssl) www.modssl.org
User Support Mailing List modssl-users@modssl.org
Automated List Manager majordomo@modssl.org