| 198 | }; |
| 199 | |
| 200 | static const char *http_errorstring(int code) |
| 201 | { |
| 202 | switch(code) { |
| 203 | #if LIBEVENT_VERSION_NUMBER >= 0x02010300 |
| 204 | case EVREQ_HTTP_TIMEOUT: |
| 205 | return "timeout reached"; |
| 206 | case EVREQ_HTTP_EOF: |
| 207 | return "EOF reached"; |
| 208 | case EVREQ_HTTP_INVALID_HEADER: |
| 209 | return "error while reading header, or invalid header"; |
| 210 | case EVREQ_HTTP_BUFFER_ERROR: |
| 211 | return "error encountered while reading or writing"; |
| 212 | case EVREQ_HTTP_REQUEST_CANCEL: |
| 213 | return "request was canceled"; |
| 214 | case EVREQ_HTTP_DATA_TOO_LONG: |
| 215 | return "response body is larger than allowed"; |
| 216 | #endif |
| 217 | default: |
| 218 | return "unknown"; |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | static void http_request_done(struct evhttp_request *req, void *ctx) |
| 223 | { |