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

  • Home
  • SEARCH
  • 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 68085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:21:41+00:00 2026-05-10T19:21:41+00:00

(See related question: How do I report an error midway through a chunked http

  • 0

(See related question: How do I report an error midway through a chunked http repsonse without closing the connection?)

In my case, the #1 desire is for the browser to display an error message. No matter how uninformative.

Closing the ServletResponse outputStream obviously doesn’t work. Neither does throwing an exception, even if I don’t close first (tested on Tomcat 6.0.16). I think that what I want is either a RST packet, FIN in the middle of a chunk, or badly formed chunk headers.

After that I can worry about how various browsers respond.

Edited for clarification: This is for a file download, perhaps several gigabytes of binary data. I can’t make certain that all of the data can be successfully read or decrypted before I have to start sending some of it.

  • 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. 2026-05-10T19:21:41+00:00Added an answer on May 10, 2026 at 7:21 pm

    My own answer, after research.

    Part one: There seems to be no way to convince the application servers that I tested to put an error onto the wire past the ‘committed’ phase. The following Servlet code results in legal HTTP Chunked Transfer headers on the socket. Interestingly, in the case of WebSphere an error message is appended to the end of the stream before the end mark.

    public class Servlet extends HttpServlet {     public static final int ARRAY_SIZE = 65536;     private static final int SEND_COUNT = 100000;      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException {          String testData = 'This is a fairly long piece of test text, running on and on and on, over and over.';          final ServletOutputStream outputStream = response.getOutputStream();         for (int i = 0; i < SEND_COUNT; ++i) {             outputStream.println(testData);         }         throw new ServletException('Break it now');     } } 

    Part two: Even if the application server was willing to either write bogus data to the wire or close the socket without a closing zero length chunk, common clients do not report an error. IE7, FF3 and cURL do not report errors in chunk encoding. This makes HTTP downloads inherently unreliable, and is contrary to the spirit if not the letter of the HTTP 1.1 RFC.

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

Sidebar

Ask A Question

Stats

  • Questions 61k
  • Answers 61k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer It is notoriously difficult to insert rows into a GridView.… May 11, 2026 at 9:55 am
  • added an answer I don't think you can do it using robots.txt. The… May 11, 2026 at 9:55 am
  • added an answer In your current code you don't make use of any… May 11, 2026 at 9:55 am

Related Questions

(See related question: How do I report an error midway through a chunked http
While related questions have been asked before I would like to see an idea
Many times when I read books related to CSS I see things like this
(see here for the problem I'm trying to solve) How do you get hibernate
See title. By lightweight markup I mean something like markdown or wikitext.
See title: what does it mean for a C++ function to be inline?
See code: var file1 = 50.xsl; var file2 = 30.doc; getFileExtension(file1); //returns xsl getFileExtension(file2);
See the question. I want to see the methods and classes offered by a
See: Understanding Pointers In many C flavoured languages, and some older languages like Fortran,
See also How does a WCF server inform a WCF client about changes? (Better

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.