Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    CURL usage in ACB

    Scheduled Pinned Locked Moved Development
    1 Posts 1 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      serbus
      last edited by

      Hello!

      I was looking at some of the curl code in pfsense and found a common curl coding sequence, especially in services_acb.php and acb.inc, where :

              $curl_session = curl_init();
      	// curl_setopt calls
      	$data = curl_exec($curl_session);
      	if (curl_errno($curl_session)) {
      		// curl error handling code...
      	} else {
      		curl_close($curl_session);
      		// curl success code...
      	}
      

      curl_close is only called if there is no curl_errno.

      The PHP docs indicate that curl_close should be called regardless.

      John

      Lex parsimoniae

      1 Reply Last reply Reply Quote 0
      • stephenw10S stephenw10 moved this topic from General pfSense Questions on
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.