Bläddra i källkod

Don't pass through zero-length requests

tags/v0.9.3
Michael Brown 17 år sedan
förälder
incheckning
2c67167929
1 ändrade filer med 12 tillägg och 0 borttagningar
  1. 12
    0
      src/net/stream.c

+ 12
- 0
src/net/stream.c Visa fil

@@ -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;

Laddar…
Avbryt
Spara