Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce memory footprint when parsing HTTP result #115

Merged
merged 7 commits into from
Mar 18, 2019

Commits on Dec 13, 2018

  1. Test parseCurlResult with large response

    Would throw an excpetion like following message
    
        PHPUnit\Framework\Exception: PHP Fatal error:  Allowed memory size of
        73400320 bytes exhausted (tried to allocate 31457312 bytes) in
        /home/gasolwu/Code/sabre-http/lib/Client.php on line 437
    Gasol Wu committed Dec 13, 2018
    Configuration menu
    Copy the full SHA
    dbb7c46 View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2018

  1. Test sendAsync using PHP built-in web server in CI

    Gasol Wu committed Dec 14, 2018
    Configuration menu
    Copy the full SHA
    a08e6b4 View commit details
    Browse the repository at this point in the history
  2. Remove strict attribute in the XML configuration

    Let PHPUnit be quiet
    
        PHPUnit 7.5.1 by Sebastian Bergmann and contributors.
    
          Warning - The configuration file did not pass validation!
          The following problems have been detected:
    
          Line 8:
          - Element 'phpunit', attribute 'strict': The attribute 'strict' is not allowed.
    
          Test results may not be as expected.
    
    See sebastianbergmann/phpunit@78c8865
    Gasol Wu committed Dec 14, 2018
    Configuration menu
    Copy the full SHA
    3394c44 View commit details
    Browse the repository at this point in the history
  3. Remove enforceTimeLimit attribute

    The feature needs to install additional package.
    
        Error: Package phpunit/php-invoker is required for enforcing time limits
    Gasol Wu committed Dec 14, 2018
    Configuration menu
    Copy the full SHA
    bc1743a View commit details
    Browse the repository at this point in the history
  4. Reduce memory footprint when parsing HTTP result

    In order to resolve sabre-io#82 to avoid additional memory copy of response body
    (from $response to $responseBody), We deperecated `parseCurlResult` method
    which use `substr` function to separate HTTP headers and body and create new
    method `parseCurlResponse` instead. We register `receiveCurlHeader` method
    as callback function by curl_setopt using `CURLOPT_HEADERFUNCTION` option.
    
    This changes is not intended to resolve issue sabre-io#15
    
    See sabre-io#115 (comment)
    Gasol Wu committed Dec 14, 2018
    Configuration menu
    Copy the full SHA
    951f76f View commit details
    Browse the repository at this point in the history
  5. Eliminate property $beInherited

    Use local variable instead
    Gasol Wu committed Dec 14, 2018
    Configuration menu
    Copy the full SHA
    3811b56 View commit details
    Browse the repository at this point in the history
  6. Ensure a string return by curlExec

    Fix error like
    
        TypeError: Return value of Sabre\HTTP\Client::curlExec() must be of
        the type string, boolean returned
    Gasol Wu committed Dec 14, 2018
    Configuration menu
    Copy the full SHA
    3fe1452 View commit details
    Browse the repository at this point in the history