diff --git a/src/netius/clients/mjpg.py b/src/netius/clients/mjpg.py index 1f59a738..3ad17221 100644 --- a/src/netius/clients/mjpg.py +++ b/src/netius/clients/mjpg.py @@ -46,9 +46,9 @@ class MJPGProtocol(http.HTTPProtocol): MAGIC_JPEG = b"\xff\xd8\xff\xe0" - """ The magic signature for the jpeg infra-structure, this + """ The magic signature for the JPEG infra-structure, this sequence of bytes is going to be used to detect new frames - coming from the http based stream """ + coming from the HTTP based stream """ EOI_JPEG = b"\xff\xd9" """ The sequence of bytes that indicate the end of the current diff --git a/src/netius/common/geo.py b/src/netius/common/geo.py index faec2b14..2e323ac4 100644 --- a/src/netius/common/geo.py +++ b/src/netius/common/geo.py @@ -50,7 +50,7 @@ class GeoResolver(object): information database (to be used in execution) """ DOWNLOAD_URL = "https://files.bemisc.com/maxmind/GeoLite2-City.mmdb.gz" - """ The url to the compressed version of the GeoIP + """ The URL to the compressed version of the GeoIP city database used for resolution """ VALID = ("continent", "country", "city", "location") diff --git a/src/netius/common/http2.py b/src/netius/common/http2.py index 7dfe1111..37ff29c2 100644 --- a/src/netius/common/http2.py +++ b/src/netius/common/http2.py @@ -44,7 +44,6 @@ import netius from . import http -from . import util from . import parser HEADER_SIZE = 9 diff --git a/src/netius/extra/proxy_r.py b/src/netius/extra/proxy_r.py index 62f6bddb..ff1bf848 100644 --- a/src/netius/extra/proxy_r.py +++ b/src/netius/extra/proxy_r.py @@ -285,7 +285,7 @@ def on_headers(self, connection, parser): ) # verifies if the current host requires some kind of special authorization - # process using the default basic http authorization process + # process using the default basic HTTP authorization process auth = self.auth.get(DEFAULT_NAME, None) auth = self.auth.get(host, auth) auth = self.auth.get(host_s, auth) @@ -378,7 +378,7 @@ def on_headers(self, connection, parser): # verifies if the current connection already contains a valid # a proxy connection if that's the case that must be unset from # the connection and from the connection map internal structures - # at least until the http client returns from the method call + # at least until the HTTP client returns from the method call proxy_c = hasattr(connection, "proxy_c") and connection.proxy_c proxy_c = proxy_c or None connection.proxy_c = None @@ -393,7 +393,7 @@ def on_headers(self, connection, parser): # calls the proper (HTTP) method in the client this should acquire # a new connection and start the process of sending the request - # to the associated http server (request handling) + # to the associated HTTP server (request handling) _connection = self.http_client.method( method, url, @@ -425,7 +425,7 @@ def on_headers(self, connection, parser): # not been yet established (no data has been received) self.debug("Setting connection as waiting, proxy connection loading ...") - # sets the current http back-end client connection as waiting and then + # sets the current HTTP back-end client connection as waiting and then # maps it as the proxy connection in the connection and also creates # the reverse mapping using the connection map of the current server _connection.waiting = True diff --git a/src/netius/servers/http.py b/src/netius/servers/http.py index 9a747e87..8c6cdfde 100644 --- a/src/netius/servers/http.py +++ b/src/netius/servers/http.py @@ -370,7 +370,7 @@ def send_header( ) # "notifies" the owner of the connection that the headers have been - # sent all the http header information should be present + # sent all the HTTP header information should be present self.owner.on_send_http( self.connection_ctx, self.parser_ctx, @@ -403,12 +403,12 @@ def parse(self, data): def resolve_encoding(self, parser): # in case the "target" encoding is the plain one nothing # is required to be done as this is allowed by any kind - # of http compliant connection (returns immediately) + # of HTTP compliant connection (returns immediately) if self.encoding == PLAIN_ENCODING: self.current = PLAIN_ENCODING # if the target encoding is chunked must verify if the - # type of http connection in question is 1.1 or above + # type of HTTP connection in question is 1.1 or above # otherwise must down-grade the encoding to plain elif self.encoding == CHUNKED_ENCODING: if parser.version < netius.common.HTTP_11: diff --git a/src/netius/servers/http2.py b/src/netius/servers/http2.py index 2c80aa15..1f2f4fce 100644 --- a/src/netius/servers/http2.py +++ b/src/netius/servers/http2.py @@ -412,7 +412,7 @@ def callback(connection): ) # "notifies" the owner of the connection that the headers have been - # sent all the http header information should be present + # sent all the HTTP header information should be present self.owner.on_send_http( self.connection_ctx, self.parser_ctx, diff --git a/src/netius/servers/proxy.py b/src/netius/servers/proxy.py index 38f04c2d..8085d49f 100644 --- a/src/netius/servers/proxy.py +++ b/src/netius/servers/proxy.py @@ -206,7 +206,7 @@ def on_data(self, connection, data): # tries to retrieve the reference to the tunnel connection # currently set in the connection in case it does not exists - # (initial handshake or http client proxy) runs the parse + # (initial handshake or HTTP client proxy) runs the parse # step on the data and then returns immediately tunnel_c = hasattr(connection, "tunnel_c") and connection.tunnel_c if not tunnel_c: connection.parse(data); return @@ -343,7 +343,7 @@ def _raw_throttle(self, connection): def _on_prx_headers(self, client, parser, headers): # retrieves the owner of the parser as the client connection - # and then retrieves all the other http specific values + # and then retrieves all the other HTTP specific values _connection = parser.owner code_s = parser.code_s status_s = parser.status_s @@ -588,7 +588,7 @@ def _apply_via(self, parser_prx, headers): # tries to retrieve the current via string (may already exits) # and appends the created string to the base string or creates - # a new one (as defined in the http specification) + # a new one (as defined in the HTTP specification) via = headers.get("Via", "") if via: via += ", " via += via_s diff --git a/src/netius/servers/torrent.py b/src/netius/servers/torrent.py index 0023d8d7..8672e1d6 100644 --- a/src/netius/servers/torrent.py +++ b/src/netius/servers/torrent.py @@ -598,12 +598,12 @@ def peers_tracker(self): # the various trackers from each of them for tracker_url in tracker: # retrieves the first element of the tracker structure as the - # url of it and then verifies that it references an http based + # URL of it and then verifies that it references an HTTP based # tracker (as that's the only one supported) is_http = tracker_url.startswith(("http://", "https://")) if not is_http: continue - # runs the get http retrieval call (blocking call) so that it's + # runs the get HTTP retrieval call (blocking call) so that it's # possible to retrieve the contents for the announce of the tracker # this is an asynchronous call and the on tracker callback will be # called at the end of the process with the message diff --git a/src/netius/servers/ws.py b/src/netius/servers/ws.py index 65753fcc..bc0356bf 100644 --- a/src/netius/servers/ws.py +++ b/src/netius/servers/ws.py @@ -140,7 +140,7 @@ def on_data(self, connection, data): netius.StreamServer.on_data(self, connection, data) # iterates while there's still data pending to be parsed from the - # current message received using the http or ws protocols + # current message received using the HTTP or WS protocols while data: if connection.handshake: # retrieves the current (pending) buffer of data for the