随心而动,随意而行.

没有理想的人和行尸走肉又有什么区别呢.

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

 

填写http头:

r->headers_out.content_length_n = ctx->response_bufs->buf->last -ctx->response_bufs->buf->pos;
r->headers_out.status = NGX_HTTP_OK;
ngx_str_set(&r->headers_out.status_line,"200 OK"); 
r->headers_out.content_type.len = sizeof("text/html; charset=utf-8") - 1;
r->headers_out.content_type.data = (u_char *) "text/html; charset=utf-8";

发送http头和http体:

ngx_tcp_con_fill_response_eader(r,ctx);
    rc = ngx_http_send_header(r);
    if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
        return ;
    }

    rc = ngx_http_output_filter( r,ctx->response_bufs );
    ngx_http_finalize_request(r, rc);

 

posted on 2014-05-15 18:28  随心而动,随意而行  阅读(264)  评论(0编辑  收藏  举报