Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4324814
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T09:11:00+00:00 2026-05-21T09:11:00+00:00

I am writing an HTTP parser for a transparent proxy. What is stumping me

  • 0

I am writing an HTTP parser for a transparent proxy. What is stumping me is the Trailer: mentioned in the specs for Transfer-Encoding: chunked. What does it look like?

Normally, a HTTP chunked ends like this.

0\r\n
\r\n

What I am confused about is how to detect the end of the chunk if there is some sort of trailing headers…

UPDATE: I believe that a simple \r\n\r\n i.e. an empty line is enough to detect the end of trailing headers… Is that correct?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T09:11:00+00:00Added an answer on May 21, 2026 at 9:11 am

    0\r\n
    SomeAfterHeader: TheData \r\n
    \r\n

    In other words, it is sufficient to look for a \r\n\r\n, in layman’s terms: a blank line. To detect the end of a chunked transmission. But it is very important that each chunk is read before doing this. Because the chunked data itself can contain blank lines which would erroneously be detected as the end of the stream.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing python code to parse data from http://www.istockphoto.com/ and it seems like the
I'm writing a simple HTTP server and I have code like this to parse
context: im writing a favicon parser: http://plugins.trac.wordpress.org/browser/wp-favicons/trunk/includes/class-http.php and http://wp.leau.co/2011/03/18/handling-redirects-for-wp-favicons-with-redirects-set-to-0-with-wordpress-wp_remote_get/ I saw : http://www.foxfilm.nl/favicon.ico in
I'm writing a simple phone number parser based on [ libphonenumber ]. Unfortunately, http://closure-library.googlecode.com/svn/trunk/closure/goog/base.js
I'm writing http session manager (gen_server based). That server creates and removes session from
For a tool I'm writing ( http://hackage.haskell.org/package/explore ) I need a way to read
I need some help writing an http client. The trouble comes when I try
I'm writing an utility ( http://reg2run.sf.net ) which in case execution without arguments works
I am writing a basic http server in C. Handling a simple static .html
I am writing a generic Http resource hosting service and am storing larger objects

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.