[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] 5 bytes missing from starts of input buffer



Hi, 

I have a strange problem where every so often my server socket input buffer does not contain the first 5 bytes as expected.

This occurs with the first read event callback on the server after the tcp connection has been established.

The following is a normal hex dump from tcpdump...

0x0000:  4500 004b 0232 4000 4006 aaaa c0a8 065f  E..K.2@.@......_
0x0010:  c0a8 0621 dbf0 db23 174e a386 c0b0 77b2  ...!...#.N....w.
0x0020:  8018 0073 0bc9 0000 0101 080a 0be7 a1aa  ...s............
0x0030:  5d64 de1a 0000 0013 815f 4152 5900 0000  ]d......._ARY...
0x0040:  0209 4265 6e00 0300 0000 78              ..Ben.....x

And what I see in the evbuffer in my read event callback...

00000000: 00 00 00 13 81 5f 41 52 59 00 00 00 02 09 42 65   ....._ARY.....Be
00000010: 6e 00 03 00 00 00 78                              n.....x

The following is a 'bad' hex dump from tcpdump but is the same as the good one...

0x0000:  4500 004b 4210 4000 4006 6acc c0a8 065f  E..KB.@.@.j...._
0x0010:  c0a8 0621 dbf2 db23 a78a e503 88b4 be38  ...!...#.......8
0x0020:  8018 0073 7e98 0000 0101 080a 0be7 a70f  ...s~...........
0x0030:  aa6e 3896 0000 0013 815f 4152 5900 0000  .n8......_ARY...
0x0040:  0209 4265 6e00 0300 0000 78              ..Ben.....x

And what I see in the evbuffer in my read event callback...

00000000: 5f 41 52 59 00 00 00 02 09 42 65 6e 00 03 00 00   _ARY.....Ben....
00000010: 00 78                                             .x

You can see that the first 5 bytes '00 00 00 13 81' are missing from the seconds buffer dump.

I'm using libevent version 2.0.19.

Any ideas what might be going on?

Ben