| 213 | } |
| 214 | |
| 215 | Result HttpMultipartParser::initWithBoundary(StringSpan boundaryValue) |
| 216 | { |
| 217 | reset(); |
| 218 | #if SC_COMPILER_MSVC || SC_COMPILER_CLANG_CL |
| 219 | ::strncpy_s(boundaryStorage, sizeof(boundaryStorage), boundaryValue.bytesWithoutTerminator(), |
| 220 | min(sizeof(boundaryStorage) - 1, boundaryValue.sizeInBytes())); |
| 221 | #else |
| 222 | ::strncpy(boundaryStorage, boundaryValue.bytesWithoutTerminator(), |
| 223 | min(sizeof(boundaryStorage) - 1, boundaryValue.sizeInBytes())); |
| 224 | #endif |
| 225 | boundary = StringSpan::fromNullTerminated(boundaryStorage, StringEncoding::Ascii); |
| 226 | return Result(boundary.StringSpan::sizeInBytes() == boundaryValue.sizeInBytes()); |
| 227 | } |
| 228 | |
| 229 | void HttpMultipartParser::reset() |
| 230 | { |