Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropped body part on Linux w/ Dahua #22

Open
MiKoKappa opened this issue Nov 15, 2022 · 1 comment
Open

Dropped body part on Linux w/ Dahua #22

MiKoKappa opened this issue Nov 15, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@MiKoKappa
Copy link

Hi!
I have been testing alarm server with Dahua model ITC415-PW6M-IZ-C2, which has cgi-bin/snapManager.cgi API route for event management.
On Windows 10, go version 1.19.2 everything works like a charm.
On Linux Ubuntu Server, go version 1.19.3 the function part.Read from lib multipart reads out only about a half of data from response body. The other half of byte array is filled with zeros.

The issue only appears for bigger payloads (i.e. 3925 bytes, the n value from calling part.Read is only 1281).

Could you please give some advice how to address this issue?
Thank you in advance.

@MiKoKappa MiKoKappa changed the title Dropped body park on Linux w/ Dahua Dropped body part on Linux w/ Dahua Nov 15, 2022
@MiKoKappa
Copy link
Author

Managed to get full request body by using io.ReadFull in function readEvents of server.go in dahua folder as so:
_, err = io.ReadFull(part,body) instead of _, err = part.Read(body).

@toxuin toxuin added the bug Something isn't working label Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants