Skip to content

Commit

Permalink
Change CurlIppPoster::write to void*
Browse files Browse the repository at this point in the history
  • Loading branch information
attah committed Aug 19, 2023
1 parent 5cc9e05 commit f16687b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/curlrequester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ CURLcode CurlRequester::await(Bytestream* data)
return _result;
}

bool CurlIppPosterBase::write(const char* data, size_t size)
bool CurlIppPosterBase::write(const void* data, size_t size)
{
while(!_canWrite.try_lock())
{
Expand Down Expand Up @@ -155,7 +155,7 @@ CurlIppPoster::CurlIppPoster(std::string addr, const Bytestream& data, bool igno
: CurlIppPosterBase(addr, ignoreSslErrors, verbose)
{
curl_easy_setopt(_curl, CURLOPT_POSTFIELDSIZE, data.size());
write((char*)(data.raw()), data.size());
write(data.raw(), data.size());
doRun();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/curlrequester.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class CurlIppPosterBase : public CurlRequester
public:
virtual CURLcode await(Bytestream* = nullptr);

bool write(const char* data, size_t size);
bool write(const void* data, size_t size);
bool give(Bytestream& bts);
size_t requestWrite(char* dest, size_t size);

Expand Down
4 changes: 2 additions & 2 deletions utils/ippposter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ int main(int argc, char** argv)

CurlIppStreamer req(addr);

req.write((char*)(hdr.raw()), hdr.size());
req.write((char*)(data.raw()), data.size());
req.write(hdr.raw(), hdr.size());
req.write(data.raw(), data.size());

Bytestream result;

Expand Down

0 comments on commit f16687b

Please sign in to comment.