tfHttpdUserSendResponseBody

Jump to: navigation, search

Table of Contents >> Application Reference >> Web Server


#include <trsocket.h>


int tfHttpdUserSendResponseBody (
ttHttpdUserConHandle userConHandle,
ttUserConstCharPtr bufferPtr,
ttUserIntPtr bufferLenPtr,
int flags
);


Function Description

Low-level API for sending a customer defined HTTP response that overrides the default HTTP response: Send the HTTP response body through the connection.


Parameters

  • userConHandle
    User connection handle.
  • bufferPtr
    Pointer to the buffer to be sent as part of the body.
  • bufferLenPtr
    Pointer to the buffer length. The input value indicates the length of data to be sent, when this API returns, the output value is updated to be actual data length sent out.
  • flags
    This parameter is a bitmask, so values can be OR'ed together as appropriate
TM_HTTPD_FLUSH: Immediately transmit all unsent data .
TM_HTTPD_END: Indicate the end of the response message. No more body will follow.


Returns

  • TM_ENOERROR
    Success
  • TM_EINVAL
    Invalid userConHandle
  • TM_EPERM
    The status line has not been sent out yet.
  • TM_EWOULDBLOCK
    Indicates that the send queue is full, the response could not be sent out now, the user should try again.


Table of Contents >> Application Reference >> Web Server