| @@ 648-664 (lines=17) @@ | ||
| 645 | ||
| 646 | $payload = $req->payload; | |
| 647 | // Deflate request body and set appropriate request headers | |
| 648 |         if (function_exists('gzdeflate') && ($this->request_compression == 'gzip' || $this->request_compression == 'deflate')) { | |
| 649 |             if ($this->request_compression == 'gzip') { | |
| 650 | $a = @gzencode($payload); | |
| 651 |                 if ($a) { | |
| 652 | $payload = $a; | |
| 653 | $encodingHdr = "Content-Encoding: gzip\r\n"; | |
| 654 | } | |
| 655 |             } else { | |
| 656 | $a = @gzcompress($payload); | |
| 657 |                 if ($a) { | |
| 658 | $payload = $a; | |
| 659 | $encodingHdr = "Content-Encoding: deflate\r\n"; | |
| 660 | } | |
| 661 | } | |
| 662 |         } else { | |
| 663 | $encodingHdr = ''; | |
| 664 | } | |
| 665 | ||
| 666 | // thanks to Grant Rauscher <[email protected]> for this | |
| 667 | $credentials = ''; | |
| @@ 878-894 (lines=17) @@ | ||
| 875 | ||
| 876 | // Deflate request body and set appropriate request headers | |
| 877 | $payload = $req->payload; | |
| 878 |         if (function_exists('gzdeflate') && ($this->request_compression == 'gzip' || $this->request_compression == 'deflate')) { | |
| 879 |             if ($this->request_compression == 'gzip') { | |
| 880 | $a = @gzencode($payload); | |
| 881 |                 if ($a) { | |
| 882 | $payload = $a; | |
| 883 | $encodingHdr = 'Content-Encoding: gzip'; | |
| 884 | } | |
| 885 |             } else { | |
| 886 | $a = @gzcompress($payload); | |
| 887 |                 if ($a) { | |
| 888 | $payload = $a; | |
| 889 | $encodingHdr = 'Content-Encoding: deflate'; | |
| 890 | } | |
| 891 | } | |
| 892 |         } else { | |
| 893 | $encodingHdr = ''; | |
| 894 | } | |
| 895 | ||
| 896 |         if ($this->debug > 1) { | |
| 897 |             Logger::instance()->debugMessage("---SENDING---\n$payload\n---END---"); | |