TCP::Collect vs TCP::payload
I have a simple iRule as below
when CLIENT_ACCEPTED {TCP :: collect}
when CLIENT_DATA { if { [TCP::payload] contains "SomeName/SomeServiceNameHere/"} { pool APoolUsedByMyApplication }
My TCP data has 600 bytes. My intended data will be well within first 200 bytes and hence I changed to iRule as below.
when CLIENT_ACCEPTED {TCP :: collect 100}
when CLIENT_DATA { if { [TCP::payload 250] contains "SomeName/SomeServiceNameHere/"} { pool APoolUsedByMyApplication }
I am collecting only 100 bytes via TCP::Collect. But using TCP::Payload 250 and it works fine.
Am bit confused here. Do the TCP::Collect and TCP::Payload gets a fresh copy of data? Or Is Data collected in TCP::Collect is reused in TCP::Payload?
Please correct my understanding and any comments are helpful
Thanks in advance.