Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of HTTPClient by
HTTPFile.cpp
00001 #include "HTTPFile.h" 00002 00003 HTTPFile::HTTPFile(char* filename) { 00004 file = fopen(filename, "w"); 00005 } 00006 00007 void HTTPFile::close() { 00008 if (file) { 00009 fclose(file); 00010 } 00011 } 00012 00013 void HTTPFile::writeReset() { 00014 if (file) { 00015 rewind(file); 00016 } 00017 } 00018 00019 int HTTPFile::write(const char* buf, size_t len) { 00020 if (file) { 00021 len = fwrite(buf, 1, len, file); 00022 if ((!m_chunked && (ftell(file) >= m_len)) || (m_chunked && !len)) { 00023 close(); 00024 } 00025 } 00026 return len; 00027 } 00028 00029 void HTTPFile::setDataType(const char* type) { 00030 00031 } 00032 00033 void HTTPFile::setIsChunked(bool chunked) { 00034 m_chunked = chunked; 00035 } 00036 00037 void HTTPFile::setDataLen(size_t len) { 00038 m_len = len; 00039 }
Generated on Fri Jul 15 2022 02:26:42 by
1.7.2
