瀏覽代碼

Added comment.

Tatsuhiro Tsujikawa 15 年之前
父節點
當前提交
3d0764eb9d
共有 2 個文件被更改,包括 27 次插入0 次删除
  1. 6 0
      src/CreateRequestCommand.h
  2. 21 0
      src/HttpInitiateConnectionCommand.h

+ 6 - 0
src/CreateRequestCommand.h

@@ -39,6 +39,12 @@
 
 namespace aria2 {
 
+// CreateRequestCommand selects URI using URISelector object and
+// create Request object with the selected URI. Then create subsequent
+// command using
+// InitiateConnectionCommandFactory. InitiateConnectionCommandFactory
+// creates Command based on the protocol of selected URI.  If there is
+// no URI available, then throws exceptions.
 class CreateRequestCommand:public AbstractCommand {
 public:
   CreateRequestCommand(cuid_t cuid,

+ 21 - 0
src/HttpInitiateConnectionCommand.h

@@ -39,6 +39,27 @@
 
 namespace aria2 {
 
+// HttpInitiateConnectionCommand determins remote host to connect and
+// resolves IP address from that hostname and creates subsequent
+// command.  Usually, remote host is the host in URI. If proxy is
+// used, remote host becomes proxy server. This command searches
+// pooled socket using resolved IP addresses and use pooled socket if
+// available.  The following chart shows what Command is followed
+// after this command based on conditions.
+//
+// HttpInitiateConnectionCommand
+//                 |
+//                 |  proxy is used?
+//                 +----------------+
+//                 |                |
+//                 |                |  pooled socket?
+//                 |                +------------> HttpRequestCommand
+//                 |                |  tunnel?
+//                 |                +------------> HttpProxyRequestCommand
+//                 |                |  otherwise
+//                 |                +------------> HttpRequestCommand
+//                 | direct connection
+//                 +-----------------------------> HttpRequestCommand
 class HttpInitiateConnectionCommand : public InitiateConnectionCommand {
 protected:
   virtual Command* createNextCommand