| 1179 | } |
| 1180 | |
| 1181 | bool AsyncHttpClient::isEOL(const String& str, size_t& len) |
| 1182 | { |
| 1183 | bool isEOL = false; |
| 1184 | const char TERMINATOR_LF[] = "\n"; |
| 1185 | const char TERMINATOR_CRLF[] = "\r\n"; |
| 1186 | |
| 1187 | len = 0U; |
| 1188 | |
| 1189 | /* RFC7230 - 3.5. Message Parsing Robustness |
| 1190 | * Although the line terminator for the start-line and header fields is |
| 1191 | * the sequence CRLF, a recipient MAY recognize a single LF as a line |
| 1192 | * terminator and ignore any preceding CR. |
| 1193 | */ |
| 1194 | if (0U != str.endsWith(TERMINATOR_LF)) |
| 1195 | { |
| 1196 | isEOL = true; |
| 1197 | |
| 1198 | if (0U != str.endsWith(TERMINATOR_CRLF)) |
| 1199 | { |
| 1200 | len = 2U; |
| 1201 | } |
| 1202 | else |
| 1203 | { |
| 1204 | len = 1U; |
| 1205 | } |
| 1206 | } |
| 1207 | |
| 1208 | return isEOL; |
| 1209 | } |
| 1210 | |
| 1211 | bool AsyncHttpClient::handleRspHeader() |
| 1212 | { |