Browse Source

[http] Include error messages for 4xx and 5xx response codes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 6 years ago
parent
commit
ea29122a70
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      src/net/tcp/httpcore.c

+ 7
- 0
src/net/tcp/httpcore.c View File

@@ -55,6 +55,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
55 55
 #include <ipxe/params.h>
56 56
 #include <ipxe/profile.h>
57 57
 #include <ipxe/vsprintf.h>
58
+#include <ipxe/errortab.h>
58 59
 #include <ipxe/http.h>
59 60
 
60 61
 /* Disambiguate the various error causes */
@@ -110,6 +111,12 @@ static struct profiler http_rx_profiler __profiler = { .name = "http.rx" };
110 111
 /** Data transfer profiler */
111 112
 static struct profiler http_xfer_profiler __profiler = { .name = "http.xfer" };
112 113
 
114
+/** Human-readable error messages */
115
+struct errortab http_errors[] __errortab = {
116
+	__einfo_errortab ( EINFO_EIO_4XX ),
117
+	__einfo_errortab ( EINFO_EIO_5XX ),
118
+};
119
+
113 120
 static struct http_state http_request;
114 121
 static struct http_state http_headers;
115 122
 static struct http_state http_trailers;

Loading…
Cancel
Save