mirror of
https://github.com/zigzap/zap.git
synced 2025-10-21 07:34:08 +00:00
try anyway
This commit is contained in:
parent
d1a0b6c15d
commit
5f939fd666
1 changed files with 11 additions and 1 deletions
12
src/zap.zig
12
src/zap.zig
|
@ -628,10 +628,20 @@ pub fn Fiobj2HttpParam(o: fio.FIOBJ, a: std.mem.Allocator, dupe_string: bool) !?
|
||||||
} else {
|
} else {
|
||||||
// the data
|
// the data
|
||||||
const data_len = fio.fiobj_data_len(data);
|
const data_len = fio.fiobj_data_len(data);
|
||||||
const data_buf = fio.fiobj_data_read(data, data_len);
|
var data_buf = fio.fiobj_data_read(data, data_len);
|
||||||
|
|
||||||
if (data_len < 0) {
|
if (data_len < 0) {
|
||||||
std.log.warn("WARNING: HTTP param binary file size negative: {d}\n", .{data_len});
|
std.log.warn("WARNING: HTTP param binary file size negative: {d}\n", .{data_len});
|
||||||
|
|
||||||
|
// try to read anyway
|
||||||
|
std.log.warn("WARNING: Attempting to read anyway\n", .{});
|
||||||
|
data_buf = fio.fiobj_data_read(data, 4096);
|
||||||
|
if (data_buf.len > 0) {
|
||||||
|
data_slice = data_buf.data[0..data_buf.len];
|
||||||
|
} else {
|
||||||
|
std.log.warn("WARNING: HTTP param binary file buffer size negative: {d}\n", .{data_buf.len});
|
||||||
|
data_slice = "(zap: invalid data: negative BUFFER size)";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (data_buf.len != data_len) {
|
if (data_buf.len != data_len) {
|
||||||
std.log.warn("WARNING: HTTP param binary file size mismatch: should {d}, is: {d}\n", .{ data_len, data_buf.len });
|
std.log.warn("WARNING: HTTP param binary file size mismatch: should {d}, is: {d}\n", .{ data_len, data_buf.len });
|
||||||
|
|
Loading…
Add table
Reference in a new issue