comparison Core/HttpServer/MongooseServer.cpp @ 1430:ad94a3583b07

Plugins can send answers as multipart messages
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 29 Jun 2015 17:47:34 +0200
parents feaf2840917c
children af112b7d9cba
comparison
equal deleted inserted replaced
1429:7366a0bdda6a 1430:ad94a3583b07
80 80
81 virtual void Send(bool isHeader, const void* buffer, size_t length) 81 virtual void Send(bool isHeader, const void* buffer, size_t length)
82 { 82 {
83 if (length > 0) 83 if (length > 0)
84 { 84 {
85 mg_write(connection_, buffer, length); 85 int status = mg_write(connection_, buffer, length);
86 if (status != static_cast<int>(length))
87 {
88 // status == 0 when the connection has been closed, -1 on error
89 throw OrthancException(ErrorCode_NetworkProtocol);
90 }
86 } 91 }
87 } 92 }
88 93
89 virtual void OnHttpStatusReceived(HttpStatus status) 94 virtual void OnHttpStatusReceived(HttpStatus status)
90 { 95 {