| 117 | }; |
| 118 | |
| 119 | const char *http_errorstring(int code) |
| 120 | { |
| 121 | switch(code) { |
| 122 | #if LIBEVENT_VERSION_NUMBER >= 0x02010300 |
| 123 | case EVREQ_HTTP_TIMEOUT: |
| 124 | return "timeout reached"; |
| 125 | case EVREQ_HTTP_EOF: |
| 126 | return "EOF reached"; |
| 127 | case EVREQ_HTTP_INVALID_HEADER: |
| 128 | return "error while reading header, or invalid header"; |
| 129 | case EVREQ_HTTP_BUFFER_ERROR: |
| 130 | return "error encountered while reading or writing"; |
| 131 | case EVREQ_HTTP_REQUEST_CANCEL: |
| 132 | return "request was canceled"; |
| 133 | case EVREQ_HTTP_DATA_TOO_LONG: |
| 134 | return "response body is larger than allowed"; |
| 135 | #endif |
| 136 | default: |
| 137 | return "unknown"; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | static void http_request_done(struct evhttp_request *req, void *ctx) |
| 142 | { |