tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

download_firefox.h (1182B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #ifndef DOWNLOAD_FIREFOX_H
      6 #define DOWNLOAD_FIREFOX_H
      7 
      8 #include <optional>
      9 #include <string>
     10 
     11 #include "data_sink.h"
     12 
     13 enum class ErrCode {
     14  OK,
     15  ERR_EVENT,
     16  ERR_OPEN,
     17  ERR_SET_CALLBACK,
     18  ERR_CONNECT,
     19  ERR_OPEN_REQ,
     20  ERR_SEND,
     21  ERR_TIMEOUT,
     22  ERR_RECEIVE,
     23  ERR_TIMEOUT_READ,
     24  ERR_QUERY_DATA,
     25  ERR_READ_DATA,
     26  ERR_FILE,
     27  ERR_WRITE_DATA,
     28  ERR_HEADER,
     29  ERR_SERVER,
     30  ERR_CONTENT,
     31  ERR_ENVIRON,
     32  ERR_FILE_NOT_FOUND,   // Response from server was HTTP 404, file not found
     33  ERR_CLIENT_REQUEST,   // Response from server was in the 4XX range of error
     34                        // codes, but not 404
     35  ERR_REQUEST_INVALID,  // Request was invalid for the server
     36  UNKNOWN
     37 };
     38 
     39 ErrCode download_file(DataSink* dataSink, std::wstring server, int server_port,
     40                      bool is_https, std::wstring object_name,
     41                      std::wstring contentType);
     42 ErrCode download_firefox(DataSink* dataSink);
     43 std::optional<std::wstring> get_object_name();
     44 
     45 #endif