projects
/
pgpool1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2c4e2e
)
Add error checking.
author
Yoshiyuki Asaba
<y-asaba at pgfoundry.org>
Tue, 26 Feb 2008 02:21:15 +0000
(
02:21
+0000)
committer
Yoshiyuki Asaba
<y-asaba at pgfoundry.org>
Tue, 26 Feb 2008 02:21:15 +0000
(
02:21
+0000)
pool_stream.c
patch
|
blob
|
blame
|
history
diff --git
a/pool_stream.c
b/pool_stream.c
index 0ac1057e630eaf6fb7bb0586f998c1a8acb0b2b4..99ae32146227907544af5a415db836c7d3a7781d 100644
(file)
--- a/
pool_stream.c
+++ b/
pool_stream.c
@@
-335,15
+335,16
@@
int pool_write(POOL_CONNECTION *cp, void *buf, int len)
while (len > 0)
{
- int remainder =
cp->wbufsz
- cp->wbufpo;
+ int remainder =
WRITEBUFSZ
- cp->wbufpo;
- if (
remainder <= 0
)
+ if (
cp->wbufpo >= WRITEBUFSZ
)
{
/*
* Write buffer is full. so flush buffer.
* wbufpo is reset in pool_flush_it().
*/
- pool_flush_it(cp);
+ if (pool_flush_it(cp) == -1)
+ return -1;
remainder = WRITEBUFSZ;
}