mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-08 22:57:52 +00:00
commit
17cdf7c79d
@ -204,17 +204,17 @@ namespace client
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* append to json chunk of data from 1st request */
|
/* append to json chunk of data from 1st request */
|
||||||
json.write(buf->begin() + len, bytes_transferred - len);
|
json.write(buf->data() + len, bytes_transferred - len);
|
||||||
remains = req.content_length() - len;
|
remains = req.content_length() - len;
|
||||||
/* if request has Content-Length header, fetch rest of data and store to json buffer */
|
/* if request has Content-Length header, fetch rest of data and store to json buffer */
|
||||||
while (remains > 0) {
|
while (remains > 0) {
|
||||||
len = ((long int) buf->size() < remains) ? buf->size() : remains;
|
len = ((long int) buf->size() < remains) ? buf->size() : remains;
|
||||||
bytes_transferred = boost::asio::read (*socket, boost::asio::buffer (buf->data (), len));
|
bytes_transferred = boost::asio::read (*socket, boost::asio::buffer (buf->data (), len));
|
||||||
json.write(buf->begin(), bytes_transferred);
|
json.write(buf->data(), bytes_transferred);
|
||||||
remains -= bytes_transferred;
|
remains -= bytes_transferred;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
json.write(buf->begin(), bytes_transferred);
|
json.write(buf->data(), bytes_transferred);
|
||||||
}
|
}
|
||||||
LogPrint(eLogDebug, "I2PControl: json from request: ", json.str());
|
LogPrint(eLogDebug, "I2PControl: json from request: ", json.str());
|
||||||
#if GCC47_BOOST149
|
#if GCC47_BOOST149
|
||||||
|
Loading…
Reference in New Issue
Block a user