| 103 | } |
| 104 | |
| 105 | std::string IDataSource::SourceConfig::toString() |
| 106 | { |
| 107 | CicadaJSONItem item{}; |
| 108 | item.addValue("low_speed_limit", low_speed_limit); |
| 109 | item.addValue("low_speed_time_ms", low_speed_time_ms); |
| 110 | item.addValue("connect_time_out_ms", connect_time_out_ms); |
| 111 | item.addValue("so_rcv_size", so_rcv_size); |
| 112 | item.addValue("http_proxy", http_proxy); |
| 113 | item.addValue("refer", refer); |
| 114 | item.addValue("userAgent", userAgent); |
| 115 | std::string headerStr{}; |
| 116 | |
| 117 | for (std::string &headerItem : customHeaders) { |
| 118 | if (!headerItem.empty()) { |
| 119 | headerStr.append(headerItem).append(";"); |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | item.addValue("customHeaders", headerStr); |
| 124 | return item.printJSON(); |
| 125 | } |
| 126 | } |