Skip to content

Commit

Permalink
Merge pull request #1 from ldruschk/fix-asyncsocket
Browse files Browse the repository at this point in the history
fix AsyncSocket
  • Loading branch information
ldruschk authored Jun 30, 2021
2 parents 216330d + 5b13a75 commit 9e736a3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Start the checker using
uvicorn --reload example:checker.app
```

And browse to [http://localhost:8000/docs] to explore the web interface, which allows you to send requests to the checker.
And browse to (http://localhost:8000/docs) to explore the web interface, which allows you to send requests to the checker.

## Documentation

You can check out the full tutorial at [https://enowars.github.io/docs]
You can check out the full tutorial at (https://enowars.github.io/docs)
6 changes: 2 additions & 4 deletions enochecker3/enochecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
TIMEOUT_BUFFER = 2


AsyncSocket = Tuple[asyncio.StreamReader, asyncio.StreamWriter]
AsyncSocket = AsyncIterator[Tuple[asyncio.StreamReader, asyncio.StreamWriter]]


class EnocheckerException(Exception):
Expand Down Expand Up @@ -325,9 +325,7 @@ def _get_logger_adapter(
)

@contextlib.asynccontextmanager
async def _get_async_socket(
self, task: BaseCheckerTaskMessage
) -> AsyncIterator[AsyncSocket]:
async def _get_async_socket(self, task: BaseCheckerTaskMessage) -> AsyncSocket:
try:
conn = await asyncio.streams.open_connection(
task.address, self.service_port
Expand Down
2 changes: 1 addition & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ async def exploit_test(searcher: FlagSearcher, client: AsyncClient) -> Optional[
return flag

if __name__ == "__main__":
checker.run()
checker.run()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setuptools.setup(
name="enochecker3",
version="0.1.0",
version="0.1.1",
author="ldruschk",
author_email="[email protected]",
description="FastAPI based library for building async python checkers for the EnoEngine A/D CTF Framework",
Expand Down

0 comments on commit 9e736a3

Please sign in to comment.