{"record":{"id":"bae0d9b571a0b8f1","repo":"XX-net/XX-Net","slug":"direct-s-s-status-d","errorCode":null,"errorMessage":"direct %s %s % status:%d","messagePattern":"direct (.+?) (.+?) % status:(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"code/default/gae_proxy/local/direct_handler.py","lineNumber":44,"sourceCode":"\ndef handler(method, host, path, headers, body, wfile, timeout=60):\n    time_request = time.time()\n\n    if b\"Connection\" in headers and headers[b\"Connection\"] == b\"close\":\n        del headers[b\"Connection\"]\n\n    errors = []\n    while True:\n        time_left = time_request + timeout - time.time()\n        if time_left <= 0:\n            return_fail_message(wfile)\n            return \"ok\"\n\n        try:\n            response = direct_front.request(method, host, path, headers, body, timeout=time_left)\n            if response:\n                if response.status > 600:\n                    xlog.warn(\"direct %s %s % status:%d\", method, host, path, response.status)\n                    continue\n                elif response.status > 400:\n                    server_type = response.headers.get(b'Server', b\"\")\n\n                    if b\"G\" not in server_type and b\"g\" not in server_type and server_type not in google_server_types:\n\n                        xlog.debug(\"IP:%s host:%s not support GAE, server type:%s status:%d\",\n                                  response.ssl_sock.ip_str, host, server_type, response.status)\n                        #direct_front.ip_manager.report_connect_fail(response.ssl_sock.ip_str, force_remove=True)\n                        response.worker.close()\n                        continue\n                break\n        except OpenSSL.SSL.SysCallError as e:\n            errors.append(e)\n            xlog.warn(\"direct_handler.handler err:%r %s/%s\", e, host, path)\n        except Exception as e:\n            errors.append(e)\n            xlog.exception('direct_handler.handler %r %s %s , retry...', e, host, path)","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/gae_proxy/local/direct_handler.py#L26-L62","documentation":"direct_handler got an implausible HTTP status > 600 from a direct (non-proxied) request — not a real HTTP status, indicating a malformed/parsed-wrong response. It logs method/host/path/status and retries (continue).","triggerScenarios":"direct_front.request returning a response whose status field exceeds 600: corrupted response, non-HTTP server answering, H2 parser bug, or injected garbage from middleboxes.","commonSituations":"DPI injecting fake responses, connecting to a host that speaks a non-HTTP protocol on 443/80, or parser bugs on chunked/HTTP2 responses.","solutions":["Retry usually resolves transient corruption — the loop continues automatically","If persistent for one host, bypass/exclude that host or force it through the proxy","Update XX-Net for HTTP parser fixes","Check for middlebox/antivirus TLS interception on the path"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Retry direct requests on implausible status; it's usually corruption","Route persistently-broken hosts through the proxy instead of direct","Update the HTTP parser with XX-Net releases"],"tags":["direct-connection","http","malformed-response","parser"],"backgroundTag":"malformed-http-response","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}