美文网首页
http_server流程

http_server流程

作者: 李伟13 | 来源:发表于2020-10-10 14:57 被阅读0次

    Accept_request

    Http典型请求头消息
    https://blog.csdn.net/hardhard123/article/details/80232756

    
    GET http://download.microtool.de:80/somedata.exe
    
    Host: download.microtool.de
    
    Accept:*/*  /介质类型
    
    Pragma: no-cache
    
    Cache-Control: no-cache
    
    Referer: http://download.microtool.de/
    
    User-Agent:Mozilla/4.04[en](Win95;I;Nav)
    
    Range:bytes=554554-
    

    1. 使用method[255]数组存储该Client的请求头信息,通过检测第一个空格的方式实现

    如果不是 "GET" 或者 "POST" ,返回501状态码
    501 Not Implemented
    501状态码表示服务器不支持当前请求所需要的某个功能。当服务器无法识别请求的方法,并且无法支持其对任何资源的请求。

    2.使用url[255]数组存储url信息,通过isspace()实现

    值得注意的是,使用本地地址127.0.0.1时,GET请求的url为/

    3.将路径使用stat存储处理文件信息

    判断是否启用cgi程序.

    4.使用CGI处理.

    https://blog.csdn.net/silent123go/article/details/71108501
    使用管道进行进程间通讯,并且将CGI的输出重定向到

    相关文章

      网友评论

          本文标题:http_server流程

          本文链接:https://www.haomeiwen.com/subject/qsylpktx.html