Closed gshakir closed 5 years ago
Should be fixed in develop
now. See https://github.com/criticalstack/libevhtp/commit/517256cf35a46ad7619b34fee2a74af77b6aa841
Thank you. That worked. But setting the connection closed hook gives an error. Appreciate the help. I am doing what the examples are doing.
evpostkeys.cc:802:5: error: no matching function for call to 'evhtp_connection_set_hook'
evhtp_connection_set_hook(conn, evhtp_hook_on_conn_error, &conn_error_cb, NULL);
^~~~~~~~~
./libevhtp/include/evhtp/evhtp.h:779:18: note: candidate function not viable: no known conversion from 'evhtp_res ()(evhtp_connection_t , evhtp_error_flags, void )' (aka
'unsigned short ()(evhtp_connection_s , unsigned char, void )') to 'evhtp_hook' (aka 'unsigned short ()()') for 3rd argument
EVHTP_EXPORT int evhtp_connection_set_hook(evhtp_connection_t c, evhtp_hook_type type, evhtp_hook cb, void * arg);
^
you seem to be passing a double pointer to your callback.
Change
evhtp_connection_set_hook(conn, evhtp_hook_on_conn_error, &conn_error_cb, NULL);
to
evhtp_connection_set_hook(conn, evhtp_hook_on_conn_error, conn_error_cb, NULL);
I don't see any debug messages. I am trying to debug a closed connection on 5xx errors. Thank you.