Change buffer sizes to support GR-PEACH
Dependents: GR-PEACH_Azure_Speech
Fork of HTTPClient-SSL by
data/HTTPFile.cpp
- Committer:
- ksekimoto
- Date:
- 2015-11-07
- Revision:
- 50:7fbf8ef951f2
File content as of revision 50:7fbf8ef951f2:
#include "HTTPFile.h" HTTPFile::HTTPFile(char* filename) { file = fopen(filename, "w"); //printf("HTTPFile open:%s\r\n", filename); } void HTTPFile::close() { if (file) { //printf("HTTPFile close\r\n"); fclose(file); } } void HTTPFile::writeReset() { if (file) { rewind(file); } } int HTTPFile::write(const char* buf, size_t len) { if (file) { len = fwrite(buf, 1, len, file); if ((!m_chunked && (ftell(file) >= m_len)) || (m_chunked && !len)) { close(); } } return len; } void HTTPFile::setDataType(const char* type) { } void HTTPFile::setIsChunked(bool chunked) { m_chunked = chunked; } void HTTPFile::setDataLen(size_t len) { m_len = len; }