* Send decoded data to dillo in an HTTP envelope. */
| 162 | * Send decoded data to dillo in an HTTP envelope. |
| 163 | */ |
| 164 | static void send_decoded_data(const char *url, const char *mime_type, |
| 165 | unsigned char *data, size_t data_sz) |
| 166 | { |
| 167 | char *d_cmd; |
| 168 | |
| 169 | /* Send dpip tag */ |
| 170 | d_cmd = a_Dpip_build_cmd("cmd=%s url=%s", "start_send_page", url); |
| 171 | a_Dpip_dsh_write_str(sh, 1, d_cmd); |
| 172 | dFree(d_cmd); |
| 173 | |
| 174 | /* Send HTTP header. */ |
| 175 | a_Dpip_dsh_write_str(sh, 0, "Content-type: "); |
| 176 | a_Dpip_dsh_write_str(sh, 0, mime_type); |
| 177 | a_Dpip_dsh_write_str(sh, 1, "\n\n"); |
| 178 | |
| 179 | /* Send message */ |
| 180 | a_Dpip_dsh_write(sh, 0, (char *)data, data_sz); |
| 181 | } |
| 182 | |
| 183 | static void send_failure_message(const char *url, const char *mime_type, |
| 184 | unsigned char *data, size_t data_sz) |
no test coverage detected