Skip to content

Commit f51de60

Browse files
committed
lib: delete unused STREAM::dump
1 parent 2c519ff commit f51de60

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

include/gromox/stream.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ struct GX_EXPORT STREAM {
6262
size_t get_total_length() const { return wr_total_pos; }
6363
scopy_result copyline(char *buf, unsigned int *size);
6464
unsigned int peek_buffer(char *, unsigned int) const;
65-
int dump(int fd);
6665
int write(const void *buf, size_t);
6766

6867
std::list<stream_block>::iterator pnode_rd{}, pnode_wr{};

lib/stream.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -698,31 +698,6 @@ unsigned int STREAM::peek_buffer(char *pbuff, unsigned int size) const
698698
return actual_size;
699699
}
700700

701-
/*
702-
* dump content in stream into file
703-
* @param
704-
* pstream [in] stream object
705-
* fd file descriptor
706-
* @return
707-
* STREAM_DUMP_FAIL fail
708-
* STREAM_DUMP_OK OK
709-
*/
710-
int STREAM::dump(int fd)
711-
{
712-
void *pbuff;
713-
unsigned int size = STREAM_BLOCK_SIZE;
714-
715-
reset_reading();
716-
while ((pbuff = get_read_buf(&size)) != nullptr) {
717-
auto wr_result = ::write(fd, pbuff, size);
718-
if (wr_result < 0 || static_cast<size_t>(wr_result) != size)
719-
return STREAM_DUMP_FAIL;
720-
size = STREAM_BLOCK_SIZE;
721-
}
722-
return STREAM_DUMP_OK;
723-
}
724-
725-
726701
/*
727702
* forward the reading pointer.
728703
* @param

0 commit comments

Comments
 (0)