Pārlūkot izejas kodu

Don't pass through zero-length requests

tags/v0.9.3
Michael Brown 18 gadus atpakaļ
vecāks
revīzija
2c67167929
1 mainītis faili ar 12 papildinājumiem un 0 dzēšanām
  1. 12
    0
      src/net/stream.c

+ 12
- 0
src/net/stream.c Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt