| 24 | }; |
| 25 | |
| 26 | const char *http_errorstring(int code) |
| 27 | { |
| 28 | switch(code) { |
| 29 | #if LIBEVENT_VERSION_NUMBER >= 0x02010300 |
| 30 | case EVREQ_HTTP_TIMEOUT: |
| 31 | return "timeout reached"; |
| 32 | case EVREQ_HTTP_EOF: |
| 33 | return "EOF reached"; |
| 34 | case EVREQ_HTTP_INVALID_HEADER: |
| 35 | return "error while reading header, or invalid header"; |
| 36 | case EVREQ_HTTP_BUFFER_ERROR: |
| 37 | return "error encountered while reading or writing"; |
| 38 | case EVREQ_HTTP_REQUEST_CANCEL: |
| 39 | return "request was canceled"; |
| 40 | case EVREQ_HTTP_DATA_TOO_LONG: |
| 41 | return "response body is larger than allowed"; |
| 42 | #endif |
| 43 | default: |
| 44 | return "unknown"; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | static void http_request_done(struct evhttp_request *req, void *ctx) |
| 49 | { |