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 7 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
 #include <ipxe/params.h>
55
 #include <ipxe/params.h>
56
 #include <ipxe/profile.h>
56
 #include <ipxe/profile.h>
57
 #include <ipxe/vsprintf.h>
57
 #include <ipxe/vsprintf.h>
58
+#include <ipxe/errortab.h>
58
 #include <ipxe/http.h>
59
 #include <ipxe/http.h>
59
 
60
 
60
 /* Disambiguate the various error causes */
61
 /* Disambiguate the various error causes */
110
 /** Data transfer profiler */
111
 /** Data transfer profiler */
111
 static struct profiler http_xfer_profiler __profiler = { .name = "http.xfer" };
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
 static struct http_state http_request;
120
 static struct http_state http_request;
114
 static struct http_state http_headers;
121
 static struct http_state http_headers;
115
 static struct http_state http_trailers;
122
 static struct http_state http_trailers;

Loading…
Cancel
Save