浏览代码

Don't pass through zero-length requests

tags/v0.9.3
Michael Brown 18 年前
父节点
当前提交
2c67167929
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12
    0
      src/net/stream.c

+ 12
- 0
src/net/stream.c 查看文件

@@ -156,6 +156,10 @@ void stream_acked ( struct stream_connection *conn, size_t len ) {
156 156
 		return;
157 157
 	}
158 158
 
159
+	/* Ignore zero-length blocks */
160
+	if ( len == 0 )
161
+		return;
162
+
159 163
 	/* Hand off to application */
160 164
 	if ( app->op->acked )
161 165
 		app->op->acked ( app, len );
@@ -181,6 +185,10 @@ void stream_newdata ( struct stream_connection *conn,
181 185
 		return;
182 186
 	}
183 187
 
188
+	/* Ignore zero-length blocks */
189
+	if ( len == 0 )
190
+		return;
191
+
184 192
 	/* Hand off to application */
185 193
 	if ( app->op->newdata )
186 194
 		app->op->newdata ( app, data, len );
@@ -297,6 +305,10 @@ int stream_send ( struct stream_application *app,
297 305
 		return -ENOTCONN;
298 306
 	}
299 307
 
308
+	/* Ignore zero-length blocks */
309
+	if ( len == 0 )
310
+		return 0;
311
+
300 312
 	/* Hand off to connection */
301 313
 	if ( ! conn->op->send )
302 314
 		return -ENOTSUP;

正在加载...
取消
保存