Progressive mode edits, RTMP edits. Also, TODO: AMF3 implementen. *barf*
This commit is contained in:
parent
f8bee94f32
commit
a8c4463144
1 changed files with 22 additions and 0 deletions
|
@ -14,6 +14,9 @@ class HTTPReader{
|
|||
void SetBody(char * buffer, int len);
|
||||
std::string BuildRequest();
|
||||
std::string BuildResponse(std::string code, std::string message);
|
||||
void SendResponse(int conn, std::string code, std::string message);
|
||||
void SendBodyPart(int conn, char * buffer, int len);
|
||||
void SendBodyPart(int conn, std::string bodypart);
|
||||
void Clean();
|
||||
std::string method;
|
||||
std::string url;
|
||||
|
@ -171,4 +174,23 @@ bool HTTPReader::parse(){
|
|||
return false; //we should never get here...
|
||||
}//HTTPReader::parse
|
||||
|
||||
void HTTPReader::SendResponse(int conn, std::string code, std::string message){
|
||||
std::string tmp = BuildResponse(code, message);
|
||||
DDV_write(tmp.c_str(), tmp.size(), conn);
|
||||
}
|
||||
|
||||
void HTTPReader::SendBodyPart(int conn, char * buffer, int len){
|
||||
std::string tmp;
|
||||
tmp.append(buffer, len);
|
||||
SendBodyPart(conn, tmp);
|
||||
}
|
||||
|
||||
void HTTPReader::SendBodyPart(int conn, std::string bodypart){
|
||||
static char len[10];
|
||||
int sizelen;
|
||||
sizelen = snprintf(len, 10, "%x\r\n", (unsigned int)bodypart.size());
|
||||
DDV_write(len, sizelen, conn);
|
||||
DDV_write(bodypart.c_str(), bodypart.size(), conn);
|
||||
DDV_write(len+sizelen-2, 2, conn);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue