08\29\2007-09:57:00:451 0x84409CA8 -> StreamCallout(V4): uFlowHandle = 0x00000000000000a7
08\29\2007-09:57:00:451 0x84409CA8 flags = 0x00010000
08\29\2007-09:57:00:451 0x84409CA8 >>> SND: Bytes: 390: GET /images/I/21Ef9rIvR%2BL.jpg HTTP/1.1
08\29\2007-09:57:00:451 0x84409CA8 <- StreamCallout(V4, BLOCKING nBytes = 390)
The data is blocked and reinjected using a DPC. The data is correctly indicated at an inspection filter (stream layer):
08\29\2007-09:57:00:451 0x84409CA8 -> DpcStreamInject(V4, 202, nBytes = 390)
08\29\2007-09:57:00:451 0x84409CA8 -> StreamV4Callout_dbg(): flowHandle = 0x00000000000000a7
08\29\2007-09:57:00:451 0x84409CA8 >>> SND: Bytes: 390: GET /images/I/21Ef9rIvR%2BL.jpg HTTP/1.1
08\29\2007-09:57:00:451 0x84409CA8 <- StreamV4Callout_dbg()
08\29\2007-09:57:00:451 0x84409CA8 <- DpcStreamInject(V4, 202)
Data is received 20ms later:
08\29\2007-09:57:00:473 0x84409CA8 -> StreamCallout(V4): uFlowHandle = 0x00000000000000a7
08\29\2007-09:57:00:473 0x84409CA8 flags = 0x00000001
08\29\2007-09:57:00:473 0x84409CA8 <<< RCV: Bytes: 614: HTTP/1.1 304 Not Modified
08\29\2007-09:57:00:473 0x84409CA8 <- StreamCallout(V4, BLOCKING nBytes = 614)
The received data is blocked and reinjected:
08\29\2007-09:57:00:473 0x84409CA8 -> DpcStreamInject(V4, 203, nBytes = 614)
08\29\2007-09:57:00:473 0x84409CA8 -> StreamInjectCompletion(V4, 202): nBytes = 390
08\29\2007-09:57:00:473 0x84409CA8 -> StreamV4Callout_dbg(): flowHandle = 0x00000000000000a7
08\29\2007-09:57:00:473 0x84409CA8 <<< RCV: Bytes: 614: HTTP/1.1 304 Not Modified
08\29\2007-09:57:00:473 0x84409CA8 <- StreamV4Callout_dbg()
08\29\2007-09:57:00:473 0x84409CA8 <- DpcStreamInject(V4, 203)
08\29\2007-09:57:00:473 0x84409CA8 -> StreamInjectCompletion(V4, 203): nBytes = 614
All data is injected now and was indicated to the next stream filter, so everything should be OK. Now it takes exactly 500ms till the app sends the next request. Again, data is send and received:
08\29\2007-09:57:00:973 0x84409CA8 -> StreamCallout(V4): uFlowHandle = 0x00000000000000a7
08\29\2007-09:57:00:973 0x84409CA8 flags = 0x00010000
08\29\2007-09:57:00:973 0x84409CA8 >>> SND: Bytes: 338: GET /images/I/11W4MYC3E1L.jpg HTTP/1.1
08\29\2007-09:57:00:973 0x84409CA8 <- StreamCallout(V4, BLOCKING nBytes = 338)
08\29\2007-09:57:00:973 0x84409CA8 -> DpcStreamInject(V4, 209, nBytes = 338)
08\29\2007-09:57:00:973 0x84409CA8 -> StreamV4Callout_dbg(): flowHandle = 0x00000000000000a7
08\29\2007-09:57:00:973 0x84409CA8 >>> SND: Bytes: 338: GET /images/I/11W4MYC3E1L.jpg HTTP/1.1
08\29\2007-09:57:00:973 0x84409CA8 <- StreamV4Callout_dbg()
08\29\2007-09:57:00:973 0x84409CA8 <- DpcStreamInject(V4, 209)
08\29\2007-09:57:01:09 0x84409CA8 -> StreamCallout(V4): uFlowHandle = 0x00000000000000a7
08\29\2007-09:57:01:09 0x84409CA8 flags = 0x00000001
08\29\2007-09:57:01:09 0x84409CA8 <<< RCV: Bytes: 1460: HTTP/1.1 200 OK
08\29\2007-09:57:01:09 0x84409CA8 <- StreamCallout(V4, BLOCKING nBytes = 1460)
08\29\2007-09:57:01:09 0x84409CA8 -> StreamInjectCompletion(V4, 209): nBytes = 338
08\29\2007-09:57:01:09 0x84409CA8 -> StreamCallout(V4): uFlowHandle = 0x00000000000000a7
08\29\2007-09:57:01:09 0x84409CA8 flags = 0x00000001
08\29\2007-09:57:01:09 0x84409CA8 <<< RCV: Bytes: 1460: aqìaHè?K1IUíà?5?Xa3??uX?£9?óêG ?
08\29\2007-09:57:01:09 0x84409CA8 <- StreamCallout(V4, BLOCKING nBytes = 1460)
08\29\2007-09:57:01:09 0x84409CA8 -> DpcStreamInject(V4, 210, nBytes = 1460)
08\29\2007-09:57:01:09 0x84409CA8 -> StreamV4Callout_dbg(): flowHandle = 0x00000000000000a7
08\29\2007-09:57:01:09 0x84409CA8 <<< RCV: Bytes: 1460: HTTP/1.1 200 OK
08\29\2007-09:57:01:09 0x84409CA8 <- StreamV4Callout_dbg()
08\29\2007-09:57:01:09 0x84409CA8 -> StreamCallout(V4): uFlowHandle = 0x00000000000000a7
08\29\2007-09:57:01:09 0x84409CA8 flags = 0x00000001
08\29\2007-09:57:01:09 0x84409CA8 <<< RCV: Bytes: 702: ?#s,`7?Ez???.???)áù·? ?eˉ??
08\29\2007-09:57:01:09 0x84409CA8 <- StreamCallout(V4, BLOCKING nBytes = 702)
08\29\2007-09:57:01:09 0x84409CA8 -> StreamInjectCompletion(V4, 210): nBytes = 1460
08\29\2007-09:57:01:09 0x84409CA8 <- DpcStreamInject(V4, 210)
08\29\2007-09:57:01:09 0x84409CA8 -> DpcStreamInject(V4, 211, nBytes = 1460)
08\29\2007-09:57:01:09 0x84409CA8 -> StreamV4Callout_dbg(): flowHandle = 0x00000000000000a7
08\29\2007-09:57:01:09 0x84409CA8 <<< RCV: Bytes: 1460: aqìaHè?K1IUíà?5?Xa3??uX?£9?óêG ?
08\29\2007-09:57:01:09 0x84409CA8 <- StreamV4Callout_dbg()
08\29\2007-09:57:01:09 0x84409CA8 <- DpcStreamInject(V4, 211)
08\29\2007-09:57:01:09 0x84409CA8 -> DpcStreamInject(V4, 212, nBytes = 702)
08\29\2007-09:57:01:09 0x84409CA8 -> StreamV4Callout_dbg(): flowHandle = 0x00000000000000a7
08\29\2007-09:57:01:09 0x84409CA8 <<< RCV: Bytes: 702: ?#s,`7?Ez???.???)áù·? ?eˉ?
08\29\2007-09:57:01:09 0x84409CA8 <- StreamV4Callout_dbg()
08\29\2007-09:57:01:09 0x84409CA8 <- DpcStreamInject(V4, 212)
08\29\2007-09:57:01:09 0x84409CA8 -> StreamInjectCompletion(V4, 211): nBytes = 1460
08\29\2007-09:57:01:09 0x84409CA8 -> StreamInjectCompletion(V4, 212): nBytes = 702
All data is received and reinjected, and again the next request takes more or less exactly 500ms to be send out:
08\29\2007-09:57:01:517 0x84409CA8 -> StreamCallout(V4): uFlowHandle = 0x00000000000000a7
08\29\2007-09:57:01:517 0x84409CA8 flags = 0x00010000
08\29\2007-09:57:01:517 0x84409CA8 >>> SND: Bytes: 340: GET /images/I/11rW%2Biv1AmL.jpg HTTP/1.1
08\29\2007-09:57:01:517 0x84409CA8 <- StreamCallout(V4, BLOCKING nBytes = 340)
This all happens on one connection (always the same flow handle). If I just download a file for example, everything is fast and OK. Only those "ping-pong-connections" cause this strange 500ms delay.
I think this should be easy for you to reproduce. Install a product which installs a TDI driver (I took a trial version of Kaspersky Internet Security 7.0). Then you need a callout driver which clones every stream packet and just injects it back to the network stack. Then you should be able to see the problem (for example www.amazon.de is good for testing).
So, any idea what goes wrong here?