Forum Discussion
yuce_sungur_100
Nimbostratus
Mar 03, 2010iRule transforms from raw socket to HTTP POST,
I have been working on a project that transofrms raw socket to HTTP POST requests.It has been working nice until a huge packet arrives.My irule is succesfully merges all the tcp packets and send them to backend in a POST body but "Content-length" header of the HTTP request seems to be miscalculated.
relevant iRule lines are;
append veri "\r\nContent-Length: "
append veri [TCP::payload length]
"
any idea to correct the issue?
TCP::payload length must give the final length of the two merged packets.
- hoolio
Cirrostratus
You'd need to calculate the number of bytes in the HTTP payload for the HTTP content-length header--not the length of the TCP payload. You could try subtracting the length of the HTTP headers from the TCP payload size, or just parse the TCP for the length of the HTTP payload. - yuce_sungur_100
Nimbostratus
the problem occurs during the transformation from raw socket data to http data.if the input data is two packet length, my irule is correctly placing headers,creates three packets from 2 packets.The content is correct but the content-length value is equal to the length of only the first packet payload.Somehow irule can sense the two packets need to be chunked but it miscalculates the length of the payload. - hoolio
Cirrostratus
Hi Ysungur, - yuce_sungur_100
Nimbostratus
Is there anyway to catch PSH flag in client packet, or CLIENT_DATA simply exits when there is push in the request
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects