mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
THRIFT-1228. php: The php accelerator module calls flush incorrectly
This patch makes sure that filling the php extension's internal buffer does not cause a premature flush of the whole transport. Patch: Nathaniel Cook git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1141668 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ad0ad824d2
commit
2323aa9c1c
@ -177,7 +177,7 @@ public:
|
||||
|
||||
void write(const char* data, size_t len) {
|
||||
if ((len + buffer_used) > buffer_size) {
|
||||
flush();
|
||||
internalFlush();
|
||||
}
|
||||
if (len > buffer_size) {
|
||||
directWrite(data, len);
|
||||
@ -218,15 +218,18 @@ public:
|
||||
}
|
||||
|
||||
void flush() {
|
||||
if (buffer_used) {
|
||||
directWrite(buffer, buffer_used);
|
||||
buffer_ptr = buffer;
|
||||
buffer_used = 0;
|
||||
}
|
||||
internalFlush();
|
||||
directFlush();
|
||||
}
|
||||
|
||||
protected:
|
||||
void internalFlush() {
|
||||
if (buffer_used) {
|
||||
directWrite(buffer, buffer_used);
|
||||
buffer_ptr = buffer;
|
||||
buffer_used = 0;
|
||||
}
|
||||
}
|
||||
void directFlush() {
|
||||
zval ret;
|
||||
ZVAL_NULL(&ret);
|
||||
|
Loading…
Reference in New Issue
Block a user