We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
--limit-max-requests not working
Hi! I'm trying to figure out why my workers are not restarting as expected when using the `--limit-max-requests` flag. I ran `uvicorn` in debug mode and noticed that the `self.server_state.total_requests` count is not increasing (stays at 0 after each request) so `self.server_state.total_requests >= self.config.limit_max_requests` never returns `True`. 
When looking into where the `total_requests` was used, I noticed that the `protocols.http.[auto/h11/httptools]` were never getting called. I tried forcing the `--http h11` and `--http httptools` parameters, without any change in behavior. Any help would be appreciated!

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `uvicorn/workers.py`
Content:
```
1 import asyncio
2 
3 from gunicorn.workers.base import Worker
4 
5 from uvicorn.config import Config
6 from uvicorn.main import Server
7 
8 
9 class UvicornWorker(Worker):
10     """
11     A worker class for Gunicorn that interfaces with an ASGI consumer callable,
12     rather than a WSGI callable.
13     """
14 
15     CONFIG_KWARGS = {"loop": "uvloop", "http": "httptools"}
16 
17     def __init__(self, *args, **kwargs):
18         super(UvicornWorker, self).__init__(*args, **kwargs)
19 
20         self.log.level = self.log.loglevel
21 
22         config_kwargs = {
23             "app": None,
24             "logger": self.log,
25             "timeout_keep_alive": self.cfg.keepalive,
26             "timeout_notify": self.timeout,
27             "callback_notify": self.callback_notify,
28         }
29 
30         if self.cfg.is_ssl:
31             ssl_kwargs = {
32                 "ssl_keyfile": self.cfg.ssl_options.get("keyfile"),
33                 "ssl_certfile": self.cfg.ssl_options.get("certfile"),
34                 "ssl_version": self.cfg.ssl_options.get("ssl_version"),
35                 "ssl_cert_reqs": self.cfg.ssl_options.get("cert_reqs"),
36                 "ssl_ca_certs": self.cfg.ssl_options.get("ca_certs"),
37                 "ssl_ciphers": self.cfg.ssl_options.get("ciphers"),
38             }
39             config_kwargs.update(ssl_kwargs)
40 
41         config_kwargs.update(self.CONFIG_KWARGS)
42 
43         self.config = Config(**config_kwargs)
44 
45     def init_process(self):
46         self.config.setup_event_loop()
47         super(UvicornWorker, self).init_process()
48 
49     def init_signals(self):
50         pass
51 
52     def run(self):
53         self.config.app = self.wsgi
54         server = Server(config=self.config)
55         loop = asyncio.get_event_loop()
56         loop.run_until_complete(
57             server.serve(sockets=self.sockets, shutdown_servers=False)
58         )
59 
60     async def callback_notify(self):
61         self.notify()
62 
63 
64 class UvicornH11Worker(UvicornWorker):
65     CONFIG_KWARGS = {"loop": "asyncio", "http": "h11"}
66
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/uvicorn/workers.py b/uvicorn/workers.py
--- a/uvicorn/workers.py
+++ b/uvicorn/workers.py
@@ -25,6 +25,7 @@
             "timeout_keep_alive": self.cfg.keepalive,
             "timeout_notify": self.timeout,
             "callback_notify": self.callback_notify,
+            "limit_max_requests": self.max_requests,
         }
 
         if self.cfg.is_ssl:

{"golden_diff": "diff --git a/uvicorn/workers.py b/uvicorn/workers.py\n--- a/uvicorn/workers.py\n+++ b/uvicorn/workers.py\n@@ -25,6 +25,7 @@\n             \"timeout_keep_alive\": self.cfg.keepalive,\n             \"timeout_notify\": self.timeout,\n             \"callback_notify\": self.callback_notify,\n+            \"limit_max_requests\": self.max_requests,\n         }\n \n         if self.cfg.is_ssl:\n", "issue": "--limit-max-requests not working\nHi! I'm trying to figure out why my workers are not restarting as expected when using the `--limit-max-requests` flag. I ran `uvicorn` in debug mode and noticed that the `self.server_state.total_requests` count is not increasing (stays at 0 after each request) so `self.server_state.total_requests >= self.config.limit_max_requests` never returns `True`. \r\nWhen looking into where the `total_requests` was used, I noticed that the `protocols.http.[auto/h11/httptools]` were never getting called. I tried forcing the `--http h11` and `--http httptools` parameters, without any change in behavior. Any help would be appreciated!\n", "before_files": [{"content": "import asyncio\n\nfrom gunicorn.workers.base import Worker\n\nfrom uvicorn.config import Config\nfrom uvicorn.main import Server\n\n\nclass UvicornWorker(Worker):\n    \"\"\"\n    A worker class for Gunicorn that interfaces with an ASGI consumer callable,\n    rather than a WSGI callable.\n    \"\"\"\n\n    CONFIG_KWARGS = {\"loop\": \"uvloop\", \"http\": \"httptools\"}\n\n    def __init__(self, *args, **kwargs):\n        super(UvicornWorker, self).__init__(*args, **kwargs)\n\n        self.log.level = self.log.loglevel\n\n        config_kwargs = {\n            \"app\": None,\n            \"logger\": self.log,\n            \"timeout_keep_alive\": self.cfg.keepalive,\n            \"timeout_notify\": self.timeout,\n            \"callback_notify\": self.callback_notify,\n        }\n\n        if self.cfg.is_ssl:\n            ssl_kwargs = {\n                \"ssl_keyfile\": self.cfg.ssl_options.get(\"keyfile\"),\n                \"ssl_certfile\": self.cfg.ssl_options.get(\"certfile\"),\n                \"ssl_version\": self.cfg.ssl_options.get(\"ssl_version\"),\n                \"ssl_cert_reqs\": self.cfg.ssl_options.get(\"cert_reqs\"),\n                \"ssl_ca_certs\": self.cfg.ssl_options.get(\"ca_certs\"),\n                \"ssl_ciphers\": self.cfg.ssl_options.get(\"ciphers\"),\n            }\n            config_kwargs.update(ssl_kwargs)\n\n        config_kwargs.update(self.CONFIG_KWARGS)\n\n        self.config = Config(**config_kwargs)\n\n    def init_process(self):\n        self.config.setup_event_loop()\n        super(UvicornWorker, self).init_process()\n\n    def init_signals(self):\n        pass\n\n    def run(self):\n        self.config.app = self.wsgi\n        server = Server(config=self.config)\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(\n            server.serve(sockets=self.sockets, shutdown_servers=False)\n        )\n\n    async def callback_notify(self):\n        self.notify()\n\n\nclass UvicornH11Worker(UvicornWorker):\n    CONFIG_KWARGS = {\"loop\": \"asyncio\", \"http\": \"h11\"}\n", "path": "uvicorn/workers.py"}], "after_files": [{"content": "import asyncio\n\nfrom gunicorn.workers.base import Worker\n\nfrom uvicorn.config import Config\nfrom uvicorn.main import Server\n\n\nclass UvicornWorker(Worker):\n    \"\"\"\n    A worker class for Gunicorn that interfaces with an ASGI consumer callable,\n    rather than a WSGI callable.\n    \"\"\"\n\n    CONFIG_KWARGS = {\"loop\": \"uvloop\", \"http\": \"httptools\"}\n\n    def __init__(self, *args, **kwargs):\n        super(UvicornWorker, self).__init__(*args, **kwargs)\n\n        self.log.level = self.log.loglevel\n\n        config_kwargs = {\n            \"app\": None,\n            \"logger\": self.log,\n            \"timeout_keep_alive\": self.cfg.keepalive,\n            \"timeout_notify\": self.timeout,\n            \"callback_notify\": self.callback_notify,\n            \"limit_max_requests\": self.max_requests,\n        }\n\n        if self.cfg.is_ssl:\n            ssl_kwargs = {\n                \"ssl_keyfile\": self.cfg.ssl_options.get(\"keyfile\"),\n                \"ssl_certfile\": self.cfg.ssl_options.get(\"certfile\"),\n                \"ssl_version\": self.cfg.ssl_options.get(\"ssl_version\"),\n                \"ssl_cert_reqs\": self.cfg.ssl_options.get(\"cert_reqs\"),\n                \"ssl_ca_certs\": self.cfg.ssl_options.get(\"ca_certs\"),\n                \"ssl_ciphers\": self.cfg.ssl_options.get(\"ciphers\"),\n            }\n            config_kwargs.update(ssl_kwargs)\n\n        config_kwargs.update(self.CONFIG_KWARGS)\n\n        self.config = Config(**config_kwargs)\n\n    def init_process(self):\n        self.config.setup_event_loop()\n        super(UvicornWorker, self).init_process()\n\n    def init_signals(self):\n        pass\n\n    def run(self):\n        self.config.app = self.wsgi\n        server = Server(config=self.config)\n        loop = asyncio.get_event_loop()\n        loop.run_until_complete(\n            server.serve(sockets=self.sockets, shutdown_servers=False)\n        )\n\n    async def callback_notify(self):\n        self.notify()\n\n\nclass UvicornH11Worker(UvicornWorker):\n    CONFIG_KWARGS = {\"loop\": \"asyncio\", \"http\": \"h11\"}\n", "path": "uvicorn/workers.py"}]}