http.h

来自「konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版」· C头文件 代码 · 共 578 行 · 第 1/2 页

H
578
字号
  bool httpOpenConnection();   // Open connection  void httpCloseConnection();  // Close connection  void httpCheckConnection();  // Check whether to keep connection.  void forwardHttpResponseHeader();  bool readHeader();  bool sendBody();  // where dataInternal == true, the content is to be made available  // to an internal function.  bool readBody( bool dataInternal = false );  /**   * Performs a WebDAV stat or list   */  void davSetRequest( const QCString& requestXML );  void davStatList( const KURL& url, bool stat = true );  void davParsePropstats( const QDomNodeList& propstats, KIO::UDSEntry& entry );  void davParseActiveLocks( const QDomNodeList& activeLocks,                            uint& lockCount );  /**   * Parses a date & time string   */  long parseDateTime( const QString& input, const QString& type );  /**   * Returns the error code from a "HTTP/1.1 code Code Name" string   */  int codeFromResponse( const QString& response );  /**   * Extracts locks from metadata   * Returns the appropriate If: header   */  QString davProcessLocks();  /**   * Send a cookie to the cookiejar   */  void addCookies( const QString &url, const QCString &cookieHeader);  /**   * Look for cookies in the cookiejar   */  QString findCookies( const QString &url);  /**   * Do a cache lookup for the current url. (m_state.url)   *   * @param readWrite If true, file is opened read/write.   *                  If false, file is opened read-only.   *   * @return a file stream open for reading and at the start of   *         the header section when the Cache entry exists and is valid.   *         0 if no cache entry could be found, or if the entry is not   *         valid (any more).   */  FILE *checkCacheEntry(bool readWrite = false);  /**   * Create a cache entry for the current url. (m_state.url)   *   * Set the contents type of the cache entry to 'mimetype'.   */  void createCacheEntry(const QString &mimetype, time_t expireDate);  /**   * Write data to cache.   *   * Write 'nbytes' from 'buffer' to the Cache Entry File   */  void writeCacheEntry( const char *buffer, int nbytes);  /**   * Close cache entry   */  void closeCacheEntry();  /**   * Update expire time of current cache entry.   */  void updateExpireDate(time_t expireDate, bool updateCreationDate=false);  /**   * Quick check whether the cache needs cleaning.   */  void cleanCache();  /**   * Performs a GET HTTP request.   */  // where dataInternal == true, the content is to be made available  // to an internal function.  void retrieveContent( bool dataInternal = false );  /**   * Performs a HEAD HTTP request.   */  bool retrieveHeader(bool close_connection = true);  /**   * Resets any per session settings.   */  void resetSessionSettings();  /**   * Resets settings related to parsing a response.   */  void resetResponseSettings();  /**   * Resets any per connection settings.  These are different from   * per-session settings in that they must be invalidates every time   * a request is made, e.g. a retry to re-send the header to the   * server, as compared to only when a new request arrives.   */  void resetConnectionSettings();  /**   * Returns any pre-cached proxy authentication info   * info in HTTP header format.   */  QString proxyAuthenticationHeader();  /**   * Retrieves authorization info from cache or user.   */  bool getAuthorization();  /**   * Saves valid authorization info in the cache daemon.   */  void saveAuthorization();  /**   * Creates the entity-header for Basic authentication.   */  QString createBasicAuth( bool isForProxy = false );  /**   * Creates the entity-header for Digest authentication.   */  QString createDigestAuth( bool isForProxy = false );  /**   * Creates the entity-header for NTLM authentication.   */  QString createNTLMAuth( bool isForProxy = false );  /**   * Creates the entity-header for Negotiate authentication.   */  QString createNegotiateAuth();  /**   * create GSS error string   */  QCString gssError( int major_status, int minor_status );  /**   * Calcualtes the message digest response based on RFC 2617.   */  void calculateResponse( DigestAuthInfo &info, QCString &Response );  /**   * Prompts the user for authorization retry.   */  bool retryPrompt();  /**   * Creates authorization prompt info.   */  void promptInfo( KIO::AuthInfo& info );protected:  HTTPState m_state;  HTTPRequest m_request;  QPtrList<HTTPRequest> m_requestQueue;  bool m_bBusy; // Busy handling request queue.  bool m_bEOF;  bool m_bEOD;//--- Settings related to a single response only  QStringList m_responseHeader; // All headers  KURL m_redirectLocation;  bool m_bRedirect; // Indicates current request is a redirection  // Processing related  bool m_bChunked; // Chunked tranfer encoding  KIO::filesize_t m_iSize; // Expected size of message  KIO::filesize_t m_iBytesLeft; // # of bytes left to receive in this message.  KIO::filesize_t m_iContentLeft; // # of content bytes left  QByteArray m_bufReceive; // Receive buffer  bool m_dataInternal; // Data is for internal consumption  char m_lineBuf[1024];  char m_rewindBuf[4096];  size_t m_rewindCount;  char *m_linePtr;  size_t m_lineCount;  char *m_lineBufUnget;  char *m_linePtrUnget;  size_t m_lineCountUnget;  // Mimetype determination  bool m_cpMimeBuffer;  QByteArray m_mimeTypeBuffer;  // Language/Encoding related  QStringList m_qTransferEncodings;  QStringList m_qContentEncodings;  QString m_sContentMD5;  QString m_strMimeType;//--- WebDAV  // Data structure to hold data which will be passed to an internal func.  QByteArray m_bufWebDavData;  QStringList m_davCapabilities;  bool m_davHostOk;  bool m_davHostUnsupported;//----------  // Holds the POST data so it won't get lost on if we  // happend to get a 401/407 response when submitting,  // a form.  QByteArray m_bufPOST;  // Cache related  int m_maxCacheAge; // Maximum age of a cache entry.  long m_maxCacheSize; // Maximum cache size in Kb.  QString m_strCacheDir; // Location of the cache.//--- Proxy related members  bool m_bUseProxy;  bool m_bNeedTunnel; // Whether we need to make a SSL tunnel  bool m_bIsTunneled; // Whether we have an active SSL tunnel  bool m_bProxyAuthValid;  int m_iProxyPort;  KURL m_proxyURL;  QString m_strProxyRealm;  // Operation mode  QCString m_protocol;  // Authentication  QString m_strRealm;  QString m_strAuthorization;  QString m_strProxyAuthorization;  HTTP_AUTH Authentication;  HTTP_AUTH ProxyAuthentication;  bool m_bUnauthorized;  short unsigned int m_iProxyAuthCount;  short unsigned int m_iWWWAuthCount;  // First request on a connection  bool m_bFirstRequest;  // Persistent connections  bool m_bKeepAlive;  int m_keepAliveTimeout; // Timeout in seconds.  // Persistent proxy connections  bool m_bPersistentProxyConnection;  // Indicates whether there was some connection error.  bool m_bError;  // Previous and current response codes  unsigned int m_responseCode;  unsigned int m_prevResponseCode;  // Values that determine the remote connection timeouts.  int m_proxyConnTimeout;  int m_remoteConnTimeout;  int m_remoteRespTimeout;  int m_pid;};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?