FreeBSD/contrib/serf/outgoing.c
/* Check if there is data waiting to be sent over the socket. This can happen
   in two situations:
   - The connection queue has atleast one request with unwritten data.
   - All requests are written and the ssl layer wrote some data while reading
     the response. This can happen when the server triggers a renegotiation,
     e.g. after the first and only request on that connection was received.
   Returns 1 if data is pending on CONN, NULL if not.
   If NEXT_REQ is not NULL, it will be filled in with the next available request
   with unwritten data. */
Check if there is data waiting to be sent over the socket. This can happen
in two situations:
The connection queue has atleast one request with unwritten data.
All requests are written and the ssl layer wrote some data while reading
the response. This can happen when the server triggers a renegotiation,
e.g. after the first and only request on that connection was received.
Returns 1 if data is pending on CONN, NULL if not.
If NEXT_REQ is not NULL, it will be filled in with the next available request
with unwritten data.
Check if there is data waiting to be sent over the socket . This can happen in two situations : The connection queue has atleast one request with unwritten data . All requests are written and the ssl layer wrote some data while reading the response . This can happen when the server triggers a renegotiation e . g . after the first and only request on that connection was received . Returns 1 if data is pending on CONN NULL if not . If NEXT_REQ is not NULL it will be filled in with the next available request with unwritten data .
static int
request_or_data_pending(serf_request_t **next_req, serf_connection_t *conn)
{
    serf_request_t *request = conn->requests;
    while (request != NULL && request->req_bkt == NULL &&
           request->writing_started)
        request = request->next;
    if (next_req)
        *next_req = request;
    if (request != NULL) {
        return 1;
    } else if (conn->ostream_head) {
        const char *dummy;
        apr_size_t len;
        apr_status_t status;
        status = serf_bucket_peek(conn->ostream_head, &dummy,
                                  &len);
        if (!SERF_BUCKET_READ_ERROR(status) && len) {
            serf__log_skt(CONN_VERBOSE, __FILE__, conn->skt,
                          "All requests written but still data pending.\n");
            return 1;
        }
    }
    return 0;
}
static int request_or_data_pending ( serf_request_t * * next_req , serf_connection_t * conn ) { serf_request_t * request = conn -> requests ; while ( request != NULL && request -> req_bkt == NULL && request -> writing_started ) request = request -> next ; if ( next_req ) * next_req = request ; if ( request != NULL ) { return 1 ; } else if ( conn -> ostream_head ) { const char * dummy ; apr_size_t len ; apr_status_t status ; status = serf_bucket_peek ( conn -> ostream_head , & dummy , & len ) ; if ( ! SERF_BUCKET_READ_ERROR ( status ) && len ) { serf__log_skt ( CONN_VERBOSE , __FILE__ , conn -> skt , " \n " ) ; return 1 ; } } return 0 ; }
Check if there is data waiting to be sent over the socket.
Check if there is data waiting to be sent over the socket .