projects
/
mailer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6a545ce
)
Content-Length: 1 caused the slow response... :(
author
Roland Häder
<roland@mxchange.org>
Thu, 26 Nov 2009 00:44:44 +0000
(
00:44
+0000)
committer
Roland Häder
<roland@mxchange.org>
Thu, 26 Nov 2009 00:44:44 +0000
(
00:44
+0000)
inc/functions.php
patch
|
blob
|
history
diff --git
a/inc/functions.php
b/inc/functions.php
index aa691935e1f452796adb75cae04fdce88fbf1e81..a7cd723a8d52654eee61469a7306f962cc33a7cc 100644
(file)
--- a/
inc/functions.php
+++ b/
inc/functions.php
@@
-1766,8
+1766,9
@@
function sendGetRequest ($script, $data = array()) {
$request .= 'Accept-Charset: UTF-8,*' . getConfig('HTTP_EOL');
$request .= 'Cache-Control: no-cache' . getConfig('HTTP_EOL');
$request .= 'Content-Type: text/plain' . getConfig('HTTP_EOL');
$request .= 'Accept-Charset: UTF-8,*' . getConfig('HTTP_EOL');
$request .= 'Cache-Control: no-cache' . getConfig('HTTP_EOL');
$request .= 'Content-Type: text/plain' . getConfig('HTTP_EOL');
- $request .= 'Content-Length: '.strlen($body) . getConfig('HTTP_EOL');
- $request .= 'Connection: close' . getConfig('HTTP_EOL') . getConfig('HTTP_EOL');
+ $request .= 'Content-Length: 0' . getConfig('HTTP_EOL');
+ $request .= 'Connection: close' . getConfig('HTTP_EOL');
+ $request .= getConfig('HTTP_EOL');
// Send the raw request
$response = sendRawRequest($host, $request);
// Send the raw request
$response = sendRawRequest($host, $request);
@@
-1798,7
+1799,10
@@
function sendPostRequest ($script, $postData) {
$request .= 'User-Agent: ' . getConfig('TITLE') . '/' . getConfig('FULL_VERSION') . getConfig('HTTP_EOL');
$request .= 'Cache-Control: no-cache' . getConfig('HTTP_EOL');
$request .= 'Content-Type: application/x-www-form-urlencoded' . getConfig('HTTP_EOL');
$request .= 'User-Agent: ' . getConfig('TITLE') . '/' . getConfig('FULL_VERSION') . getConfig('HTTP_EOL');
$request .= 'Cache-Control: no-cache' . getConfig('HTTP_EOL');
$request .= 'Content-Type: application/x-www-form-urlencoded' . getConfig('HTTP_EOL');
- $request .= 'Connection: close' . getConfig('HTTP_EOL') . getConfig('HTTP_EOL');
+ $request .= 'Connection: close' . getConfig('HTTP_EOL');
+ $request .= getConfig('HTTP_EOL');
+
+ // Add body
$request .= $body;
// Send the raw request
$request .= $body;
// Send the raw request
@@
-1920,6
+1924,12
@@
function sendRawRequest ($host, $request) {
// Close socket
fclose($fp);
// Close socket
fclose($fp);
+ // Time request if debug-mode is enabled
+ if (isDebugModeEnabled()) {
+ // Add debug message...
+ logDebugMessage(__FUNCTION__, __LINE__, 'Request took ' . (microtime(true) - $start) . ' seconds.');
+ } // END - if
+
// Skip first empty lines
$resp = $response;
foreach ($resp as $idx => $line) {
// Skip first empty lines
$resp = $response;
foreach ($resp as $idx => $line) {