Browse Source

Don't pass through zero-length requests

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
2c67167929
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      src/net/stream.c

+ 12
- 0
src/net/stream.c View File

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

Loading…
Cancel
Save