private void parseMultiParts(Buf src, BufRange body, KeyValueRanges data, BufRanges dataContentTypes, Map<String, List<Upload>> files, BufRange multipartBoundary, RapidoidHelper helper) { int start = body.start; int limit = body.limit(); int sepLen = multipartBoundary.length + 2; int pos1 = -1, pos2; try { while ((pos2 = BytesUtil.find(src.bytes(), start, limit, helper.bytes, 0, sepLen, true)) >= 0) { if (pos1 >= 0 && pos2 >= 0) { int from = pos1 + sepLen + 2; int to = pos2 - 2; parseMultiPart(src, data, dataContentTypes, files, helper, from, to); } pos1 = pos2; start = pos2 + sepLen; } } catch (Throwable e) { Log.warn("Multipart parse error!", e); throw U.rte("Multipart data parse error!", e); } }
private void parseMultiParts(Buf src, BufRange body, KeyValueRanges data, BufRanges dataContentTypes, Map<String, List<Upload>> files, BufRange multipartBoundary, RapidoidHelper helper) { int start = body.start; int limit = body.limit(); int sepLen = multipartBoundary.length + 2; int pos1 = -1, pos2; try { while ((pos2 = BytesUtil.find(src.bytes(), start, limit, helper.bytes, 0, sepLen, true)) >= 0) { if (pos1 >= 0 && pos2 >= 0) { int from = pos1 + sepLen + 2; int to = pos2 - 2; parseMultiPart(src, data, dataContentTypes, files, helper, from, to); } pos1 = pos2; start = pos2 + sepLen; } } catch (Throwable e) { Log.warn("Multipart parse error!", e); throw U.rte("Multipart data parse error!", e); } }