Manage internal errors on HTTP

This is a discussion on Manage internal errors on HTTP within the Networking/Device Communication forums, part of the General Programming Boards category; Hello, I'm developing a simple server and I'm not sure on how to manage an internal error only in a ...

  1. #1
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    287

    Manage internal errors on HTTP

    Hello, I'm developing a simple server and I'm not sure on how to manage an internal error only in a certain case:

    Suppose that the server transmits a file (non chunked): first send the http header and then start sending the content; but before finish sending the file content it occurs an error (i.e.)while reading from the file.

    There's the problem: if I send a new http header specifying the error, that header will be interpreted as a part of the file; and if I kill the conection (graceful or abortive shutdown) without any information, the client will only know that the conection has been closed and will assume that if the content size is minor than the content-length specifyed in the header some problem should happened (but will be only a pressumption).

    What is the correct way in those cases?

    Thank's in advance
    Niara

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,246
    I think you've already come up with the correct answer. The server should close the connection. This will tell the client that there was an error as long as the bytes transferred is less than the content-length passed in the header.

  3. #3
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    287
    Hello bithub, thank's for the help and your time.

    I'll do in that way.

    Also I have been searching and reading a bit more and I found the Out Of Band data, but I'm not sure if they are for that purpose or if I can use it in whatever conection. That's difficult to me, so for the moment I'll close de connection and problem solved

    Thank's.
    Niara

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Http 502 and 503 errors
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 07-18-2008, 03:21 AM
  2. Internal Compiler Error
    By Elysia in forum C++ Programming
    Replies: 20
    Last Post: 07-05-2008, 03:59 AM
  3. global namespace errors
    By stubaan in forum C++ Programming
    Replies: 9
    Last Post: 04-02-2008, 03:11 PM
  4. errors in class(urgent )
    By ayesha in forum C++ Programming
    Replies: 1
    Last Post: 11-10-2001, 09:14 PM
  5. errors in class(urgent)
    By ayesha in forum C++ Programming
    Replies: 2
    Last Post: 11-10-2001, 05:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21