File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ class Client
36
36
protected $ debug ;
37
37
protected $ connect_timeout ;
38
38
protected $ timeout ;
39
+ protected $ chunk_size ;
39
40
40
41
public function __construct (array $ config )
41
42
{
@@ -100,6 +101,12 @@ public function __construct(array $config)
100
101
} else {
101
102
$ this ->timeout = 8 ;
102
103
}
104
+
105
+ if (!empty ($ config ['chunk_size ' ])) {
106
+ $ this ->chunk_size = (int ) $ config ['chunk_size ' ];
107
+ } else {
108
+ $ this ->chunk_size = 1024 ;
109
+ }
103
110
}
104
111
105
112
public function __destruct ()
@@ -340,8 +347,8 @@ private function send($buffer)
340
347
// Some servers don't like alot of data, so keep it small per chunk
341
348
$ wlen = $ length - $ pos ;
342
349
343
- if ($ wlen > 1024 ) {
344
- $ wlen = 1024 ;
350
+ if ($ wlen > $ this -> chunk_size ) {
351
+ $ wlen = $ this -> chunk_size ;
345
352
}
346
353
347
354
// try write remaining data from socket
You can’t perform that action at this time.
0 commit comments