Guest User

Untitled

a guest
Oct 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. #include <curl/curl.h>
  2. #include "httpd.h"
  3. #include "http_core.h"
  4. #include "http_protocol.h"
  5. #include "http_request.h"
  6. #include "http_log.h"
  7.  
  8. static apr_status_t test_curl_call(request_rec *r) {
  9. CURL *curl;
  10. CURLcode res;
  11. curl = curl_easy_init();
  12. if (curl) {
  13. curl_easy_setopt(curl, CURLOPT_URL, "https://google.com");
  14. curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
  15. res = curl_easy_perform(curl);
  16. if (res != CURLE_OK) {
  17. ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "CURL call failed: %s", curl_easy_strerror(res));
  18. }
  19. curl_easy_cleanup(curl);
  20. }
  21. return OK;
  22. }
  23.  
  24. static void register_hooks(apr_pool_t *pool) {
  25. ap_hook_post_read_request(test_curl_call, NULL, NULL, APR_HOOK_FIRST);
  26. }
  27.  
  28. AP_DECLARE_MODULE(curl_example) = {
  29. STANDARD20_MODULE_STUFF, NULL, NULL, NULL, NULL, NULL,
  30. register_hooks
  31. };
  32.  
  33. [Mon Oct 22 20:32:57.306320 2018] [core:notice] [pid 1392] AH00052: child pid 2211 exit signal Segmentation fault (11)
  34.  
  35. _dispatch_queue_push_queue 0x00007fff8cee26d7
  36. <unknown> 0x00007ffffffffff8
  37. _dispatch_queue_wakeup_with_qos_slow 0x00007fff8cee0b06
  38. _dispatch_mach_msg_send 0x00007fff8cee713f
  39. dispatch_mach_send 0x00007fff8cee68dc
  40. _xpc_connection_send_message_with_reply_f 0x000000010220ac8b
  41. xpc_connection_send_message_with_reply_sync 0x000000010220ab92
  42. __78-[CFPrefsPlistSource sendRequestNewDataMessage:toConnection:retryCount:error:]_block_invoke 0x00007fff958c2e86
  43. CFPREFERENCES_IS_WAITING_FOR_CFPREFSD 0x00007fff9586dea6
  44. -[CFPrefsPlistSource sendRequestNewDataMessage:toConnection:retryCount:error:] 0x00007fff958c2dfa
  45. __50-[CFPrefsPlistSource alreadylocked_requestNewData]_block_invoke 0x00007fff958c2cfb
  46. _CFPrefsWithDaemonConnection 0x00007fff9586e9bd
  47. -[CFPrefsPlistSource alreadylocked_requestNewData] 0x00007fff958c2c1b
  48. _copyValueForKey 0x00007fff958a1004
  49. -[CFPrefsPlistSource copyValueForKey:] 0x00007fff958a0ef3
  50. ___CFPreferencesCopyValueWithContainer_block_invoke 0x00007fff958a0ea0
  51. +[CFPrefsSource withSourceForIdentifier:user:byHost:container:perform:] 0x00007fff9586b3dd
  52. _CFPreferencesCopyValueWithContainer 0x00007fff958a0e3c
  53. _SSLContextReadDefault 0x000000010258dabe
  54. __pthread_once_handler 0x00007fff8d892bf6
  55. _os_once 0x00007fff841f2fc4
  56. pthread_once 0x00007fff8d892b95
  57. SSLCreateContextWithRecordFuncs 0x000000010258bfe9
  58. SSLCreateContext 0x000000010258be74
  59. darwinssl_connect_common 0x00007fff9577fb99
  60. Curl_ssl_connect_nonblocking 0x00007fff9577ef9e
  61. Curl_http_connect 0x00007fff95747e69
  62. Curl_protocol_connect 0x00007fff957563df
  63. multi_runsingle 0x00007fff957689d3
  64. curl_multi_perform 0x00007fff95768656
  65. curl_easy_perform 0x00007fff95761b10
  66.  
  67. test_curl_call mod_curl_example.c:15
  68.  
  69. ap_run_post_read_request 0x0000000102062f2c
  70. ap_read_request 0x0000000102062afe
  71. ap_process_http_connection 0x0000000102078cb0
  72. ap_run_process_connection 0x0000000102056b7e
  73. child_main 0x000000010228c81e
  74. make_child 0x000000010228c30f
  75. startup_children 0x000000010228c368
  76. prefork_run 0x000000010228b5ce
  77. ap_run_mpm 0x0000000102058ff7
  78. main 0x000000010204d56a
  79. start 0x00007fff9839c5ad
Add Comment
Please, Sign In to add comment