aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Fox <pgf@brightstareng.com>2005-07-20 18:42:52 +0000
committerPaul Fox <pgf@brightstareng.com>2005-07-20 18:42:52 +0000
commit77ee52333c9bf64540752459101972fbeef539f8 (patch)
treec20f6360151f390afb2fea25a9be37481da51374
parent54690dc0b25d5413445d190696707478a9e8f604 (diff)
downloadbusybox-w32-77ee52333c9bf64540752459101972fbeef539f8.tar.gz
busybox-w32-77ee52333c9bf64540752459101972fbeef539f8.tar.bz2
busybox-w32-77ee52333c9bf64540752459101972fbeef539f8.zip
applying fix for:
0000185: httpd infinite loop when piping to CGI script
-rw-r--r--networking/httpd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 94fcfc8c1..e3f4027dc 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1259,6 +1259,8 @@ static int sendCgi(const char *url,
1259 post_readed_idx += count; 1259 post_readed_idx += count;
1260 if(post_readed_size == 0) 1260 if(post_readed_size == 0)
1261 post_readed_idx = 0; 1261 post_readed_idx = 0;
1262 } else {
1263 post_readed_size = post_readed_idx = bodyLen = 0; /* broken pipe to CGI */
1262 } 1264 }
1263 } else if(bodyLen > 0 && post_readed_size == 0 && FD_ISSET(a_c_r, &readSet)) { 1265 } else if(bodyLen > 0 && post_readed_size == 0 && FD_ISSET(a_c_r, &readSet)) {
1264 count = bodyLen > sizeof(wbuf) ? sizeof(wbuf) : bodyLen; 1266 count = bodyLen > sizeof(wbuf) ? sizeof(wbuf) : bodyLen;
@@ -1266,7 +1268,7 @@ static int sendCgi(const char *url,
1266 if(count > 0) { 1268 if(count > 0) {
1267 post_readed_size += count; 1269 post_readed_size += count;
1268 bodyLen -= count; 1270 bodyLen -= count;
1269 } else { 1271 } else {
1270 bodyLen = 0; /* closed */ 1272 bodyLen = 0; /* closed */
1271 } 1273 }
1272 } 1274 }