Skip to content

Commit

Permalink
Merge branch 'main' of github.com:nuvious/UPNPseudograph
Browse files Browse the repository at this point in the history
  • Loading branch information
nuvious committed Jul 23, 2024
2 parents 7ce67d0 + 5b4de9f commit 00e5832
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ A detailed overview is available in a whitepapaer in [markdown](Whitepaper.md) a

[![UPNPseudograph](https://img.youtube.com/vi/BKqg3oSyqzU/0.jpg)](https://www.youtube.com/watch?v=BKqg3oSyqzU)

A detailed overview is available in a whitepapaer in [markdown](Whitepaper.md) and [pdf](Whitepaper.pdf) formats.

## Dependencies

Clone the repository:
Expand Down Expand Up @@ -94,6 +96,6 @@ There are other arguments you can pass in depending on preference:

# References

https://quimby.gnus.org/internet-drafts/draft-cai-ssdp-v1-03.txt
https://openconnectivity.org/upnp-specs/UPnP-arch-DeviceArchitecture-v2.0-20200417.pdf
https://github.com/MoshiBin/ssdpy
[1] Contributing Members of the UPnP Forum, “UPnPTM Device Architecture 1.1,” 2008. Available: https://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf. [Accessed: Jul. 23, 2024]

[2] x011, “x011/SecretPixel,” GitHub, Mar. 29, 2024. Available: https://github.com/x011/SecretPixel. [Accessed: Jul. 22, 2024]
1 change: 1 addition & 0 deletions src/upnpseudograph/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def process_message(self, agent_ip: str, message: bytes):
elif command == ord('g'):
try:
full_path = message_content.decode('utf8')
print(f"Received get request for {full_path} from {agent_ip}.")
file_name = os.path.basename(full_path).encode('utf8')
filename_length = len(file_name).to_bytes(4, byteorder='big')
with open(full_path, 'rb') as f:
Expand Down
2 changes: 1 addition & 1 deletion src/upnpseudograph/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def _benchmark_icon(public_key: rsa.RSAPublicKey, icon: typing.Dict):
int
The number of bytes that can be encoded in the image
"""
gen_byte_string = lambda x : os.urandom(x) # pylint: disable=W0108,C3001
icon_bytes = icon.get('content')
if not icon_bytes:
return 0
Expand Down Expand Up @@ -97,6 +96,7 @@ def benchmark_icons(public_key: rsa.RSAPublicKey, icons: typing.Dict):
capacity = _benchmark_icon(public_key, icon)
icon['_capacity'] = capacity
benchmarked_icons[icon_path] = icon
print(f"Capacity of icon {icon_path} is {capacity}.")
return benchmarked_icons


Expand Down

0 comments on commit 00e5832

Please sign in to comment.