Network write methods now expect struct StreamMessage

This commit is contained in:
jmjatlanta 2017-10-23 09:48:19 -05:00
parent 9afaf535d6
commit 91f5c50a71
3 changed files with 15 additions and 4 deletions

View file

@ -38,7 +38,10 @@ int ipfs_bitswap_network_send_message(const struct BitswapContext* context, stru
memcpy(buf, "/ipfs/bitswap/1.1.0\n", 20);
buf_size += 20;
// send it
int bytes_written = peer->sessionContext->default_stream->write(peer->sessionContext, buf, buf_size);
struct StreamMessage outgoing;
outgoing.data = buf;
outgoing.data_size = buf_size;
int bytes_written = peer->sessionContext->default_stream->write(peer->sessionContext, &outgoing);
if (bytes_written <= 0) {
free(buf);
return 0;