@@ -1122,6 +1122,13 @@ HttpSM::state_raw_http_server_open(int event, void *data)
11221122 case VC_EVENT_ERROR:
11231123 case VC_EVENT_EOS:
11241124 case NET_EVENT_OPEN_FAILED:
1125+ if (t_state.cause_of_death_errno == -UNKNOWN_INTERNAL_ERROR) {
1126+ if (event == VC_EVENT_EOS) {
1127+ t_state.set_connect_fail (EPIPE);
1128+ } else {
1129+ t_state.set_connect_fail (EIO);
1130+ }
1131+ }
11251132 t_state.current .state = HttpTransact::OPEN_RAW_ERROR;
11261133 // use this value just to get around other values
11271134 t_state.hdr_info .response_error = HttpTransact::STATUS_CODE_SERVER_ERROR;
@@ -2022,9 +2029,7 @@ HttpSM::state_read_server_response_header(int event, void *data)
20222029 if (allow_error == false ) {
20232030 SMDbg (dbg_ctl_http_seq, " Error parsing server response header" );
20242031 t_state.current .state = HttpTransact::PARSE_ERROR;
2025- // We set this to 0 because otherwise HttpTransact::retry_server_connection_not_open
2026- // will raise an assertion if the value is the default UNKNOWN_INTERNAL_ERROR.
2027- t_state.cause_of_death_errno = 0 ;
2032+ t_state.set_connect_fail (EBADMSG);
20282033
20292034 // If the server closed prematurely on us, use the
20302035 // server setup error routine since it will forward
@@ -5155,6 +5160,9 @@ HttpSM::send_origin_throttled_response()
51555160 if (t_state.dns_info .looking_up != ResolveInfo::PARENT_PROXY) {
51565161 t_state.current .retry_attempts .maximize (t_state.configured_connect_attempts_max_retries ());
51575162 }
5163+ if (t_state.cause_of_death_errno == -UNKNOWN_INTERNAL_ERROR) {
5164+ t_state.set_connect_fail (EUSERS); // Too many users.
5165+ }
51585166 t_state.current .state = HttpTransact::OUTBOUND_CONGESTION;
51595167 call_transact_and_set_next_state (HttpTransact::HandleResponse);
51605168}
@@ -5568,6 +5576,9 @@ HttpSM::do_http_server_open(bool raw, bool only_direct)
55685576 httpSessionManager.purge_keepalives ();
55695577 // Eventually may want to have a queue as the origin_max_connection does to allow for a combination
55705578 // of retries and errors. But at this point, we are just going to allow the error case.
5579+ if (t_state.cause_of_death_errno == -UNKNOWN_INTERNAL_ERROR) {
5580+ t_state.set_connect_fail (ENFILE); // Too many open files in system.
5581+ }
55715582 t_state.current .state = HttpTransact::CONNECTION_ERROR;
55725583 call_transact_and_set_next_state (HttpTransact::HandleResponse);
55735584 return ;
0 commit comments