Skip to content
This repository was archived by the owner on Jan 13, 2022. It is now read-only.
This repository was archived by the owner on Jan 13, 2022. It is now read-only.

Curl & Proxies #101

Description

@stepanselyuk

In some case the Facebook fix for calculate Curl headers (affected version) in FacebookCurlHttpClient does not fix all cases (according my logs and I got error 601 randomly), so I've changed code of fixing header size:

private function getHeaderSize() {

        $headerSize = self::$facebookCurl->getinfo( CURLINFO_HEADER_SIZE );

        // This corrects a Curl bug where header size does not account
        // for additional Proxy headers.
        if ( self::needsCurlProxyFix() ) {

            if ( preg_match( '/Content-Length: (\d+)/', $this->rawResponse, $m ) ) {

                $headerSize = mb_strlen( $this->rawResponse ) - $m[ 1 ];
            }
            elseif ( stripos( $this->rawResponse, self::CONNECTION_ESTABLISHED ) !== false ) {

                $headerSize += mb_strlen( self::CONNECTION_ESTABLISHED );
            }
        }

        return $headerSize;
}

And that error 601 does not occurred anymore.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions